|
|
@ -346,9 +346,11 @@ export const SolidityUnitTesting = (props: any) => { |
|
|
|
for(const contract of contracts) { |
|
|
|
for(const contract of contracts) { |
|
|
|
if(contract && contract !== 'summary') { |
|
|
|
if(contract && contract !== 'summary') { |
|
|
|
runningTestFileName = cleanFileName(filename, contract) |
|
|
|
runningTestFileName = cleanFileName(filename, contract) |
|
|
|
const tests = fileTestsResult[contract] |
|
|
|
const { tests, errors} = fileTestsResult[contract] |
|
|
|
if (tests?.length) { |
|
|
|
if (tests?.length) { |
|
|
|
renderTests(tests, contract, filename) |
|
|
|
renderTests(tests, contract, filename) |
|
|
|
|
|
|
|
} else if (errors) { |
|
|
|
|
|
|
|
console.log('errors---->', errors) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// show only contract and file name
|
|
|
|
// show only contract and file name
|
|
|
|
const contractCard: any = ( |
|
|
|
const contractCard: any = ( |
|
|
@ -384,11 +386,12 @@ export const SolidityUnitTesting = (props: any) => { |
|
|
|
testsResultByFilename[result.filename]['summary'] = {} |
|
|
|
testsResultByFilename[result.filename]['summary'] = {} |
|
|
|
} |
|
|
|
} |
|
|
|
if(result.type === 'contract') { |
|
|
|
if(result.type === 'contract') { |
|
|
|
testsResultByFilename[result.filename][result.value] = [] |
|
|
|
testsResultByFilename[result.filename][result.value]= {} |
|
|
|
|
|
|
|
testsResultByFilename[result.filename][result.value].tests = [] |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Set that this test is not rendered on UI
|
|
|
|
// Set that this test is not rendered on UI
|
|
|
|
result.rendered = false |
|
|
|
result.rendered = false |
|
|
|
testsResultByFilename[result.filename][result.context].push(result) |
|
|
|
testsResultByFilename[result.filename][result.context]['tests'].push(result) |
|
|
|
} |
|
|
|
} |
|
|
|
showTestsResult() |
|
|
|
showTestsResult() |
|
|
|
} |
|
|
|
} |
|
|
@ -425,7 +428,9 @@ export const SolidityUnitTesting = (props: any) => { |
|
|
|
const testsSummary = { filename, passed: result.totalPassing, failed: result.totalFailing, timeTaken: totalTime, rendered: false } |
|
|
|
const testsSummary = { filename, passed: result.totalPassing, failed: result.totalFailing, timeTaken: totalTime, rendered: false } |
|
|
|
testsResultByFilename[filename]['summary']= testsSummary |
|
|
|
testsResultByFilename[filename]['summary']= testsSummary |
|
|
|
showTestsResult() |
|
|
|
showTestsResult() |
|
|
|
} |
|
|
|
} else if (_errors) { |
|
|
|
|
|
|
|
testsResultByFilename[filename]['errors'] = _errors |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// result.errors.forEach((error, index) => {
|
|
|
|
// result.errors.forEach((error, index) => {
|
|
|
|
// this.testSuite = error.context
|
|
|
|
// this.testSuite = error.context
|
|
|
|