diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index 7a103c012b..c615a9c5e6 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -154,13 +154,13 @@ module.exports = class TestTab extends ViewPlugin { return fileName ? fileName.replace(/\//g, '_').replace(/\./g, '_') : fileName } - updateHeader (status) { + setHeader (status) { if (status) { - const label = yo`PASS` + const label = yo`
PASS
` this.outputHeader && yo.update(this.outputHeader, yo`
${label} ${this.testSuite}
${this.rawFileName}
`) } else { - const label = yo`FAIL` + const label = yo`
FAIL
` this.outputHeader && yo.update(this.outputHeader, yo`
${label} ${this.testSuite}
${this.rawFileName}
`) } @@ -168,33 +168,36 @@ module.exports = class TestTab extends ViewPlugin { updateFinalResult (_errors, result, filename) { ++this.readyTestsNumber + this.testsOutput.hidden = false + if(!result && (_errors || _errors.errors || Array.isArray(_errors) && (_errors[0].message || _errors[0].formattedMessage))) { + this.testCallback({ type: 'contract', filename }) + this.setHeader(false) + } if (_errors && _errors.errors) { _errors.errors.forEach((err) => this.renderer.error(err.formattedMessage || err.message, this.testsOutput, {type: err.severity})) - this.updateHeader(false) } else if (_errors && Array.isArray(_errors) && (_errors[0].message || _errors[0].formattedMessage)) { _errors.forEach((err) => this.renderer.error(err.formattedMessage || err.message, this.testsOutput, {type: err.severity})) - this.updateHeader(false) } else if (_errors && !_errors.errors && !Array.isArray(_errors)) { // To track error like this: https://github.com/ethereum/remix/pull/1438 this.renderer.error(_errors.formattedMessage || _errors.message, this.testsOutput, {type: 'error'}) - this.updateHeader(false) } yo.update(this.resultStatistics, this.createResultLabel()) if (result) { if (result.totalPassing > 0 && result.totalFailing > 0) { this.testsOutput.appendChild(yo`
${result.totalPassing} passing, ${result.totalFailing} failing (${result.totalTime}s)
`) - this.updateHeader(false) + if (this.rawFileName === filename) this.setHeader(false) } else if (result.totalPassing > 0 && result.totalFailing <= 0) { this.testsOutput.appendChild(yo`
${result.totalPassing} passing (${result.totalTime}s)
`) - this.updateHeader(true) + if (this.rawFileName === filename) this.setHeader(true) } else if (result.totalPassing <= 0 && result.totalFailing > 0) { this.testsOutput.appendChild(yo`
${result.totalFailing} failing
`) - this.updateHeader(false) + if (this.rawFileName === filename) this.setHeader(false) } result.errors.forEach((error, index) => { - this.testsOutput.appendChild(yo``) - this.testsOutput.appendChild(yo`
Error:
${error.message}
`) - this.testsOutput.appendChild(yo`
`) + this.testsOutput.appendChild(yo`
+ + ${error.message} +
`) }) } if (this.hasBeenStopped && (this.readyTestsNumber !== this.runningTestsNumber)) { @@ -410,7 +413,7 @@ module.exports = class TestTab extends ViewPlugin { render () { this.onActivationInternal() - this.testsOutput = yo`