Files: d2f2697f296dd39aed6a8b63c6d04a736a7db5b3 / node_modules / multicb / test / errors.js
443 bytesRaw
1 | |
2 | var multicb = require('../') |
3 | var t = require('assert') |
4 | |
5 | require('interleavings').test(function (isAsync) { |
6 | |
7 | function async(cb, delay, args) { |
8 | isAsync(function() { cb.apply(null, args) })() |
9 | } |
10 | |
11 | var done = multicb() |
12 | async(done(), 5, [null, 1]) |
13 | async(done(), 15, [null, 2]) |
14 | async(done(), 10, ['fail']) |
15 | done(function(err, results) { |
16 | t.equal(err, 'fail') |
17 | t.equal(results, void 0) |
18 | isAsync.done() |
19 | }) |
20 | |
21 | }) |
22 |
Built with git-ssb-web