diff options
author | ezubarev <zubarev.eugene@gmail.com> | 2016-05-05 17:59:31 +0600 |
---|---|---|
committer | ezubarev <zubarev.eugene@gmail.com> | 2016-05-05 18:04:17 +0600 |
commit | d9a03388149e2dbfb23a3095910a707a836ca5d2 (patch) | |
tree | 66b9cdce3c2562bd929fbb4db2d2fd8fb6f9da6f /mocha_test | |
parent | e66042c60ea7fe15a0bc48536fc6ee97b3f9d324 (diff) | |
download | async-d9a03388149e2dbfb23a3095910a707a836ca5d2.tar.gz |
Add test case on resolved issue #1106
Diffstat (limited to 'mocha_test')
-rw-r--r-- | mocha_test/map.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mocha_test/map.js b/mocha_test/map.js index c830b21..5161765 100644 --- a/mocha_test/map.js +++ b/mocha_test/map.js @@ -292,4 +292,20 @@ describe("map", function() { done(); }); }); + + // Issue 1106 on github: https://github.com/caolan/async/issues/1106 + it('map main callback is called only once', function(done) { + async.map([1, 2], function(item, callback) { + try { + callback(item); + } catch (exception) { + expect(function() { + callback(exception); + }).to.throw(/already called/); + done(); + } + }, function(err) { + no_such_function(); + }); + }); }); |