diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index bd626ad892..c1afcbf666 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -41,7 +41,7 @@ module.exports = class TestTab extends ApiFactory { }) this.fileManager.event.register('currentFileChanged', (file, provider) => { - this.getTests((error, tests) => { + this.testTabLogic.getTests((error, tests) => { if (error) return tooltip(error) this.data.allTests = tests this.data.selectedTests = [...this.data.allTests] @@ -59,21 +59,6 @@ module.exports = class TestTab extends ApiFactory { }) } - getTests (cb) { - var path = this.fileManager.currentPath() - if (!path) return cb(null, []) - var provider = this.fileManager.fileProviderOf(path) - if (!provider) return cb(null, []) - var tests = [] - this.fileManager.filesFromPath(path, (error, files) => { - if (error) return cb(error) - for (var file in files) { - if (/.(_test.sol)$/.exec(file)) tests.push(provider.type + '/' + file) - } - cb(null, tests) - }) - } - listTests () { return this.data.allTests.map(test => yo``) } diff --git a/src/app/tabs/testTab/testTab.js b/src/app/tabs/testTab/testTab.js index e1d41a544e..fa1ef369ca 100644 --- a/src/app/tabs/testTab/testTab.js +++ b/src/app/tabs/testTab/testTab.js @@ -18,6 +18,21 @@ class TestTabLogic { }) } + getTests (cb) { + var path = this.fileManager.currentPath() + if (!path) return cb(null, []) + var provider = this.fileManager.fileProviderOf(path) + if (!provider) return cb(null, []) + var tests = [] + this.fileManager.filesFromPath(path, (error, files) => { + if (error) return cb(error) + for (var file in files) { + if (/.(_test.sol)$/.exec(file)) tests.push(provider.type + '/' + file) + } + cb(null, tests) + }) + } + generateTestContractSample () { return `pragma solidity >=0.4.0 <0.6.0; import "remix_tests.sol"; // this import is automatically injected by Remix.