summaryrefslogtreecommitdiff
path: root/mocha_test
diff options
context:
space:
mode:
authorezubarev <zubarev.eugene@gmail.com>2016-05-05 17:59:31 +0600
committerezubarev <zubarev.eugene@gmail.com>2016-05-05 18:04:17 +0600
commitd9a03388149e2dbfb23a3095910a707a836ca5d2 (patch)
tree66b9cdce3c2562bd929fbb4db2d2fd8fb6f9da6f /mocha_test
parente66042c60ea7fe15a0bc48536fc6ee97b3f9d324 (diff)
downloadasync-d9a03388149e2dbfb23a3095910a707a836ca5d2.tar.gz
Add test case on resolved issue #1106
Diffstat (limited to 'mocha_test')
-rw-r--r--mocha_test/map.js16
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();
+ });
+ });
});