diff --git a/examples/simple_storage2_test.sol b/examples/simple_storage2_test.sol index a87fb90f33..9c5765efce 100644 --- a/examples/simple_storage2_test.sol +++ b/examples/simple_storage2_test.sol @@ -6,8 +6,11 @@ contract MyTest2 { SimpleStorage foo; uint i = 0; - function beforeEach() { + function beforeAll() { foo = new SimpleStorage(); + } + + function beforeEach() { if (i == 1) { foo.set(200); } @@ -22,6 +25,10 @@ contract MyTest2 { return Assert.equal(foo.get(), 200, "initial value is not correct"); } -} + // TODO: the tests don't necessarily run in order + //function initialValueShouldBe400() public constant returns (bool) { + // return Assert.equal(foo.get(), 400, "initial value is not correct"); + //} +} diff --git a/run.js b/run.js index 7205c5a1e2..d39756ba1f 100644 --- a/run.js +++ b/run.js @@ -9,7 +9,7 @@ commander.action(function (filename) { let web3 = new Web3() //web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')) web3.setProvider(new Provider()) - // web3.setProvider(new web3.providers.WebsocketProvider('http://localhost:8546')) + //web3.setProvider(new web3.providers.WebsocketProvider('ws://localhost:8546')) let isDirectory = fs.lstatSync(filename).isDirectory() RemixTests.runTestFiles(filename, isDirectory, web3) diff --git a/src/compiler.js b/src/compiler.js index 6dfb321abe..886b8ca18c 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -17,8 +17,6 @@ function compileFileOrFiles (filename, isDirectory, cb) { // should be replaced with remix's & browser solidity compiler code filepath = (isDirectory ? filename : path.dirname(filename)) - //sources[filename] = {content: fs.readFileSync(path.join(filepath, filename)).toString()} - //console.dir(sources); fs.readdirSync(filepath).forEach(file => { sources[file] = {content: fs.readFileSync(path.join(filepath, file)).toString()} }) diff --git a/src/testRunner.js b/src/testRunner.js index fe868c1c2d..e2fa95eeda 100644 --- a/src/testRunner.js +++ b/src/testRunner.js @@ -83,6 +83,10 @@ function runTest (testName, testObject, testCallback, resultsCallback) { } } next() + }).on('error', function(err) { + console.dir("======== error ========"); + console.dir(err); + next(err); }) } }, function () {