aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-08-04 10:10:33 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-08-04 10:10:33 +0800
commitb955b5a89a9ed7fd74cfec84cbf4b3623e4661e4 (patch)
tree8446afa0487dbf3de4616379c04552ffe2a0fefb /test/unit
parenta8966c4a4fa03ba717ddf09c8b8cd6a19d97dfe3 (diff)
downloadtangerine-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.js11
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)
+ }
+ })
})