Skip to content

Instantly share code, notes, and snippets.

@Arachnid
Created April 8, 2016 17:16
Show Gist options
  • Save Arachnid/440e3f9b4bd2e0745b5dc410c5c17180 to your computer and use it in GitHub Desktop.
Save Arachnid/440e3f9b4bd2e0745b5dc410c5c17180 to your computer and use it in GitHub Desktop.
contract('Test', function(accounts) {
it('should increment', function(done) {
var test = Test.deployed();
test.increment().then(function(ret) {
return test.i.call();
}).then(function(ret) {
assert.equal(ret.valueOf(), 1);
return test.increment();
}).then(function(ret) {
return test.i.call();
}).then(function(ret) {
assert.equal(ret.valueOf(), 2);
}).then(done).catch(done);
});
});
contract Test {
uint public i;
function increment() {
i += 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment