Skip to content

Instantly share code, notes, and snippets.

@Arachnid
Created April 8, 2016 16:47
Show Gist options
  • Save Arachnid/f3edbf0875438a37c73d7dbce9f5b564 to your computer and use it in GitHub Desktop.
Save Arachnid/f3edbf0875438a37c73d7dbce9f5b564 to your computer and use it in GitHub Desktop.
$ truffle test test/test.js
Using environment test.
Compiling contracts...
Contract: Test
Unhandled rejection AssertionError: expected '1' to equal 2
at test.js:8:11
at tryCatcher (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/promise.js:503:31)
at Promise._settlePromise (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/promise.js:560:18)
at Promise._settlePromise0 (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/promise.js:605:10)
at Promise._settlePromises (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/promise.js:684:18)
at Async._drainQueue (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/async.js:126:16)
at Async._drainQueues (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/async.js:136:10)
at Immediate.Async.drainQueues [as _onImmediate] (/opt/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/bluebird/js/release/async.js:16:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
at Function.module.exports.loopWhile (/opt/local/lib/node_modules/truffle/node_modules/deasync/index.js:64:21)
at /opt/local/lib/node_modules/truffle/node_modules/deasync/index.js:36:18
at runTask (/opt/local/lib/node_modules/truffle/cli.js:46:12)
at Object.<anonymous> (/opt/local/lib/node_modules/truffle/cli.js:331:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
contract('Test', function(accounts) {
it('should increment', function(done) {
var test = Test.deployed();
test.increment.call().then(function(ret) {
assert.equal(ret.valueOf(), 1);
return test.increment.call();
}).then(function(ret) {
assert.equal(ret.valueOf(), 2);
});
});
});
contract Test {
uint i;
function increment() returns (uint) {
i += 1;
return i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment