|
|
@ -72,6 +72,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d |
|
|
|
const isDebugging = useRef<boolean>(false) |
|
|
|
const isDebugging = useRef<boolean>(false) |
|
|
|
const allTests = useRef<string[]>([]) |
|
|
|
const allTests = useRef<string[]>([]) |
|
|
|
const selectedTests = useRef<string[]>([]) |
|
|
|
const selectedTests = useRef<string[]>([]) |
|
|
|
|
|
|
|
const currentTestFiles:any = useRef([]) // stores files for which tests have been run
|
|
|
|
const currentErrors:any = useRef([]) // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
|
|
const currentErrors:any = useRef([]) // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
|
|
|
|
|
|
|
|
|
|
const defaultPath = 'tests' |
|
|
|
const defaultPath = 'tests' |
|
|
@ -104,7 +105,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d |
|
|
|
} |
|
|
|
} |
|
|
|
// if current file is changed while debugging and one of the files imported in test file are opened
|
|
|
|
// if current file is changed while debugging and one of the files imported in test file are opened
|
|
|
|
// do not clear the test results in SUT plugin
|
|
|
|
// do not clear the test results in SUT plugin
|
|
|
|
if (isDebugging.current && testTab.allFilesInvolved.includes(file)) return |
|
|
|
if ((isDebugging.current && testTab.allFilesInvolved.includes(file)) || currentTestFiles.current.includes(file)) return |
|
|
|
allTests.current = [] |
|
|
|
allTests.current = [] |
|
|
|
updateTestFileList() |
|
|
|
updateTestFileList() |
|
|
|
clearResults() |
|
|
|
clearResults() |
|
|
@ -394,6 +395,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d |
|
|
|
|
|
|
|
|
|
|
|
const showTestsResult = () => { |
|
|
|
const showTestsResult = () => { |
|
|
|
const filenames = Object.keys(testsResultByFilename) |
|
|
|
const filenames = Object.keys(testsResultByFilename) |
|
|
|
|
|
|
|
currentTestFiles.current = filenames |
|
|
|
for (const filename of filenames) { |
|
|
|
for (const filename of filenames) { |
|
|
|
const fileTestsResult = testsResultByFilename[filename] |
|
|
|
const fileTestsResult = testsResultByFilename[filename] |
|
|
|
const contracts = Object.keys(fileTestsResult) |
|
|
|
const contracts = Object.keys(fileTestsResult) |
|
|
|