Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50659 views
1
2
var es = require('event-stream')
3
, it = require('it-is').style('colour')
4
, d = require('d-utils')
5
6
7
exports ['write an array'] = function (test) {
8
9
var readThis = d.map(3, 6, 100, d.id) //array of multiples of 3 < 100
10
11
var writer = es.writeArray(function (err, array){
12
if(err) throw err //unpossible
13
it(array).deepEqual(readThis)
14
test.done()
15
})
16
17
d.each(readThis, writer.write.bind(writer))
18
writer.end()
19
20
}
21
22
23
exports ['writer is writable, but not readable'] = function (test) {
24
var reader = es.writeArray(function () {})
25
it(reader).has({
26
readable: false,
27
writable: true
28
})
29
30
test.done()
31
}
32