UNPKG

charlike

Version:

Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options

46 lines (39 loc) 749 B
var parallel = require('../') var test = require('tape') test('functions run in parallel', function (t) { t.plan(4) var tasks = { one: function (cb) { t.pass('cb 1') cb(null) }, two: function (cb) { t.pass('cb 2') cb(null) }, three: function (cb) { t.pass('cb 3') cb(null) } } parallel(tasks, function (err) { t.error(err) }) }) test('functions that return results', function (t) { t.plan(4) var tasks = { one: function (cb) { t.pass('cb 1') cb(null, 1) }, two: function (cb) { t.pass('cb 2') cb(null, 2) } } parallel(tasks, function (err, results) { t.error(err) t.deepEqual(results, { one: 1, two: 2 }) }) })