Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('fromNode', function () {
asyncplify
.fromNode(function (cb) { cb(null, 10); })
.pipe(tests.itShouldClose())
.pipe(tests.itShouldEndSync())
.pipe(tests.itShouldEmitValues([10]));
});
describe('skip', function () {
asyncplify
.range(5)
.skip(2)
.pipe(tests.itShouldClose())
.pipe(tests.itShouldEndSync())
.pipe(tests.itShouldEmitValues([2, 3, 4]));
});
describe('tap', function(){
asyncplify
.range(3)
.tap(function () { })
.pipe(tests.itShouldClose())
.pipe(tests.itShouldEndSync())
.pipe(tests.itShouldEmitValues([0, 1, 2]));
});
describe('infinite', function () {
asyncplify
.infinite()
.take(1)
.pipe(tests.itShouldClose())
.pipe(tests.itShouldEndSync())
.pipe(tests.itShouldEmitValues([undefined]));
});
describe('filter', function () {
asyncplify
.range(4)
.filter(function (v) { return v < 2; })
.pipe(tests.itShouldClose())
.pipe(tests.itShouldEndSync())
.pipe(tests.itShouldEmitValues([0, 1]));
});