handle error from receipt; add todo regarding orgder of tests; fix ws provider

pull/3094/head
Iuri Matias 7 years ago
parent c702e153d6
commit 4126ff1c1c
  1. 11
      examples/simple_storage2_test.sol
  2. 2
      run.js
  3. 2
      src/compiler.js
  4. 4
      src/testRunner.js

@ -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");
//}
}

@ -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)

@ -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()}
})

@ -83,6 +83,10 @@ function runTest (testName, testObject, testCallback, resultsCallback) {
}
}
next()
}).on('error', function(err) {
console.dir("======== error ========");
console.dir(err);
next(err);
})
}
}, function () {

Loading…
Cancel
Save