Files: c94bab17e0c6d926909827c46b30a3411a9ada32 / test / drain-if.js
494 bytesRaw
1 | |
2 | var pull = require('../') |
3 | var test = require('tape') |
4 | |
5 | test('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 | |
16 | test('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