diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index 01652062ad..386a5e7023 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -32,6 +32,7 @@ module.exports = class TestTab extends ViewPlugin { this.hasBeenStopped = false this.runningTestsNumber = 0 this.readyTestsNumber = 0 + this.areTestsRunning = false this.baseurl = 'https://solc-bin.ethereum.org/bin' appManager.event.on('activate', (name) => { if (name === 'solidity') this.updateRunAction(fileManager.currentFile()) @@ -63,7 +64,7 @@ module.exports = class TestTab extends ViewPlugin { this.fileManager.events.on('currentFileChanged', (file, provider) => { this.updateGenerateFileAction(file) - this.updateRunAction(file) + if (!this.areTestsRunning) this.updateRunAction(file) this.testTabLogic.getTests((error, tests) => { if (error) return tooltip(error) this.data.allTests = tests @@ -139,22 +140,18 @@ module.exports = class TestTab extends ViewPlugin { updateFinalResult (_errors, result, filename) { this.testsSummary.hidden = false + ++this.readyTestsNumber if (_errors && _errors.errors) { _errors.errors.forEach((err) => this.renderer.error(err.formattedMessage || err.message, this.testsSummary, {type: err.severity})) - return } else if (_errors && Array.isArray(_errors) && (_errors[0].message || _errors[0].formattedMessage)) { _errors.forEach((err) => this.renderer.error(err.formattedMessage || err.message, this.testsSummary, {type: err.severity})) - return } 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.testsSummary, {type: 'error'}) - return } this.testsSummary.appendChild(yo`