refactor testing error throwing

This commit is contained in:
Jakub Wojciechowski
2017-07-22 21:40:01 +01:00
parent 5e7847537a
commit b3f60b9320
10 changed files with 79 additions and 78 deletions

View File

@ -55,19 +55,19 @@ contract('PausableToken', function(accounts) {
await token.pause();
try {
await token.transfer(accounts[1], 100);
assert.fail('should have thrown before');
} catch (error) {
return assertJump(error);
assertJump(error);
}
assert.fail('should have thrown before');
});
it('should throw an error trying to transfer from another account while transactions are paused', async function() {
await token.pause();
try {
await token.transferFrom(accounts[0], accounts[1], 100);
assert.fail('should have thrown before');
} catch (error) {
return assertJump(error);
assertJump(error);
}
assert.fail('should have thrown before');
});
})