From aa3cd8c03afd7643a9bc246b680e66b8e8a3b640 Mon Sep 17 00:00:00 2001 From: Arseniy Klempner Date: Tue, 1 Nov 2016 10:21:00 -0700 Subject: [PATCH] Add test for StandardToken --- test/StandardToken.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/StandardToken.js b/test/StandardToken.js index 40382c175..6b83b32b8 100644 --- a/test/StandardToken.js +++ b/test/StandardToken.js @@ -78,4 +78,20 @@ contract('StandardToken', function(accounts) { .then(done); }); + it("should throw an error when trying to transfer more than allowed", function(done) { + var token; + return StandardTokenMock.new(accounts[0], 100) + .then(function(_token) { + token = _token; + return token.approve(accounts[1], 99); + }) + .then(function() { + return token.transferFrom(accounts[0], accounts[2], 100, {from: accounts[1]}); + }) + .catch(function(error) { + if (error.message.search('invalid JUMP') == -1) throw error + }) + .then(done); + }); + });