diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e7568074ed..6fb90eb2c3 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -200,6 +200,15 @@ class CompileTab extends ViewPlugin { return this.compilerContainer.data.selectedVersion } + // This function is used for passing the compiler configuration to 'remix-tests' + getCurrentCompilerConfig () { + return { + currentVersion: this.compilerContainer.data.selectedVersion, + evmVersion: this.compileTabLogic.evmVersion, + optimize: this.compileTabLogic.optimize + } + } + /********* * SUB-COMPONENTS */ diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index 7dcaae816f..bbf3f0796b 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -153,8 +153,15 @@ module.exports = class TestTab extends ViewPlugin { return new Promise((resolve, reject) => { let runningTest = {} runningTest[path] = { content } - let currentCompilerUrl = this.baseurl + '/' + this.compileTab.getCurrentVersion() - remixTests.runTestSources(runningTest, currentCompilerUrl, canUseWorker(this.compileTab.getCurrentVersion()), () => {}, () => {}, (error, result) => { + const {currentVersion, evmVersion, optimize} = this.compileTab.getCurrentCompilerConfig() + const currentCompilerUrl = this.baseurl + '/' + currentVersion + const compilerConfig = { + currentCompilerUrl, + evmVersion, + optimize, + usingWorker: canUseWorker(currentVersion) + } + remixTests.runTestSources(runningTest, compilerConfig, () => {}, () => {}, (error, result) => { if (error) return reject(error) resolve(result) }, (url, cb) => { @@ -166,13 +173,19 @@ module.exports = class TestTab extends ViewPlugin { runTest (testFilePath, callback) { this.loading.hidden = false this.fileManager.getFile(testFilePath).then((content) => { - var runningTest = {} + let runningTest = {} runningTest[testFilePath] = { content } - let currentCompilerUrl = this.baseurl + '/' + this.compileTab.getCurrentVersion() + const {currentVersion, evmVersion, optimize} = this.compileTab.getCurrentCompilerConfig() + const currentCompilerUrl = this.baseurl + '/' + currentVersion + const compilerConfig = { + currentCompilerUrl, + evmVersion, + optimize, + usingWorker: canUseWorker(currentVersion) + } remixTests.runTestSources( runningTest, - currentCompilerUrl, - canUseWorker(this.compileTab.getCurrentVersion()), + compilerConfig, (result) => this.testCallback(result), (_err, result, cb) => this.resultsCallback(_err, result, cb), (error, result) => {