git ssb

2+

Dominic / pull-stream



Tree: 019de9e4266b7574ce6cf22a56c1cb051638fe1a

Files: 019de9e4266b7574ce6cf22a56c1cb051638fe1a / test / drain-if.js

494 bytesRaw
1
2var pull = require('../')
3var test = require('tape')
4
5test('reduce becomes through', function (t) {
6 pull(
7 pull.values([1,2,3]),
8 pull.reduce(function (a, b) {return a + b}, 0, function (err, val) {
9 t.equal(val, 6)
10 t.end()
11 })
12 )
13})
14
15
16test('reduce becomes drain', function (t) {
17 pull(
18 pull.values([1,2,3]),
19 pull.reduce(
20 function (a, b) {return a + b},
21 0,
22 function (err, acc) {
23 t.equal(acc, 6)
24 t.end()
25 }
26 )
27 )
28})
29
30
31

Built with git-ssb-web