Upsilon-VsCode/Client/node_modules/event-stream/test/flatmap.asynct.js

18 lines
369 B
JavaScript
Raw Normal View History

2019-02-17 17:07:28 +00:00
'use strict';
var es = require('../')
, it = require('it-is')
exports ['flatmap'] = function (test) {
es.readArray([[1], [1, 2], [1, 2, 3]])
.pipe(es.flatmap(function(e, cb) {
cb(null, e + 1)
}))
.pipe(es.writeArray(function(error, array) {
test.deepEqual([2, 2, 3, 2, 3, 4], array)
test.end()
}))
}
require('./helper')(module)