diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-08-04 10:10:33 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-08-04 10:10:33 +0800 |
commit | b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4 (patch) | |
tree | 8446afa0487dbf3de4616379c04552ffe2a0fefb /test/unit | |
parent | a8966c4a4fa03ba717ddf09c8b8cd6a19d97dfe3 (diff) | |
download | tangerine-wallet-browser-b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4.tar tangerine-wallet-browser-b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4.tar.gz tangerine-wallet-browser-b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4.tar.bz2 tangerine-wallet-browser-b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4.tar.lz tangerine-wallet-browser-b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4.tar.xz tangerine-wallet-browser-b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4.tar.zst tangerine-wallet-browser-b955b5a89a9ed7fd74cfec84cbf4b3623e4661e4.zip |
add test for no callback error
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/nodeify-test.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/nodeify-test.js b/test/unit/nodeify-test.js index 06241334d..f4fe320ca 100644 --- a/test/unit/nodeify-test.js +++ b/test/unit/nodeify-test.js @@ -17,4 +17,15 @@ describe('nodeify', function () { done() }) }) + + it('should throw if the last argument is not a function', function (done) { + var nodified = nodeify(obj.promiseFunc, obj) + try { + nodified('baz') + done(new Error('should have thrown if the last argument is not a function')) + } catch (err) { + if (err.message === 'callback is not a function') done() + else done(err) + } + }) }) |