git ssb

3+

Dominic / ssb-blobs



Commit c0e9a969c5c0484a867b4ca5508beaeff462f603

Test local createWants

cel committed on 7/17/2017, 6:43:25 PM
Parent: 728a1c1cfe496aff48d0dad4e931946d23ee9e0f

Files changed

test/local.jsadded
test/local.jsView
@@ -1,0 +1,32 @@
1 +var tape = require('tape')
2 +var pull = require('pull-stream')
3 +var assert = require('assert')
4 +
5 +var u = require('./util')
6 +
7 +module.exports = function (createBlobs, createAsync) {
8 +
9 + tape('createWants does not error after abort', function (t) {
10 + createAsync(function (async) {
11 + var blobs = createBlobs('simple', async)
12 + var wants = blobs.createWants.call({id: 'test'})
13 + // abort the want stream, and then make another one
14 + wants(new Error('abort'), function (err) {
15 + t.ok(err, 'wants aborted')
16 + pull(
17 + blobs.createWants.call({id: 'test'}),
18 + async.through(),
19 + pull.take(1),
20 + pull.collect(function (err, res) {
21 + t.error(err, 'wants')
22 + t.deepEquals(res, [{}], 'empty wants')
23 + t.end()
24 + })
25 + )
26 + })
27 + })
28 + })
29 +
30 +}
31 +
32 +if(!module.parent) u.tests(module.exports)

Built with git-ssb-web