`)
})
}
- function runTest (testFilePath, provider, callback) {
- provider.get(testFilePath, (error, content) => {
+ function runTest (testFilePath, callback) {
+ self._deps.fileManager.fileProviderOf(testFilePath).get(testFilePath, (error, content) => {
if (!error) {
var runningTest = {}
runningTest[testFilePath] = { content }
remixTests.runTestSources(runningTest, testCallback, resultsCallback, (error, result) => {
updateFinalResult(error, result, testFilePath)
callback(error)
- }, (url, cb) => { this._deps.app.importFileCb(url, cb) })
+ }, (url, cb) => { self._deps.app.importFileCb(url, cb) })
}
})
}
- function getTests () {
- var path = this._deps.fileManager.currentPath()
- var provider = this._deps.fileManager.fileProviderOf(path)
+ function getTests (self) {
+ var path = self._deps.fileManager.currentPath()
+ var provider = self._deps.fileManager.fileProviderOf(path)
var tests = []
self._deps.fileManager.filesFromPath(path, (error, files) => {
if (!error) {
@@ -94,7 +86,7 @@ module.exports = class TestTab {
return tests
}
- self._events.filePanel.register('newTestFileCreated', file => {
+ self._deps.filePanel.event.register('newTestFileCreated', file => {
var testList = document.querySelector("[class^='testList']")
var test = yo``
testList.appendChild(test)
@@ -102,6 +94,9 @@ module.exports = class TestTab {
self.data.selectedTests.push(file)
})
+ self._deps.fileManager.event.register('currentFileChanged', (file, provider) => {
+ })
+
// self._events.filePanel.register('fileRenamed', (oldName, newName, isFolder) => {
// debugger
// self.data.allTests = self.data.allTests.filter(e => e != oldName)
@@ -128,7 +123,7 @@ module.exports = class TestTab {
}
var el = yo`
-
+
Test your smart contract by creating a foo_test.sol file.
Open ballot_test.sol to see the example. For more details, see
@@ -144,6 +139,7 @@ module.exports = class TestTab {
`
+ if (!self._view.el) self._view.el = el
return el
}
}