Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cel
authored and
cel
committed
Jul 17, 2017
1 parent
728a1c1
commit c0e9a96
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var tape = require('tape') | ||
var pull = require('pull-stream') | ||
var assert = require('assert') | ||
|
||
var u = require('./util') | ||
|
||
module.exports = function (createBlobs, createAsync) { | ||
|
||
tape('createWants does not error after abort', function (t) { | ||
createAsync(function (async) { | ||
var blobs = createBlobs('simple', async) | ||
var wants = blobs.createWants.call({id: 'test'}) | ||
// abort the want stream, and then make another one | ||
wants(new Error('abort'), function (err) { | ||
t.ok(err, 'wants aborted') | ||
pull( | ||
blobs.createWants.call({id: 'test'}), | ||
async.through(), | ||
pull.take(1), | ||
pull.collect(function (err, res) { | ||
t.error(err, 'wants') | ||
t.deepEquals(res, [{}], 'empty wants') | ||
t.end() | ||
}) | ||
) | ||
}) | ||
}) | ||
}) | ||
|
||
} | ||
|
||
if(!module.parent) u.tests(module.exports) |