Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit b983afe

Browse files
Fix stream tests.
1 parent 636dcd1 commit b983afe

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

test/MemoryFileSystem.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,23 +264,21 @@ describe("streams", function() {
264264
it("should read files", function(done) {
265265
var fs = new MemoryFileSystem();
266266
fs.writeFileSync("/file", "Hello");
267-
bl(fs.createReadStream("/file"), function(err, data) {
268-
err.should.eql(undefined);
269-
data.should.eql("Hello");
267+
fs.createReadStream("/file").pipe(bl(function(err, data) {
268+
data.toString('utf8').should.be.eql("Hello");
270269
done();
271-
});
270+
}));
272271
});
273272
it("should respect start/end", function(done) {
274273
var fs = new MemoryFileSystem();
275274
fs.writeFileSync("/file", "Hello");
276-
bl(fs.createReadStream("/file", {
277-
start: 2,
278-
end: 4
279-
}), function(err, data) {
280-
err.should.eql(undefined);
281-
data.should.eql("el");
275+
fs.createReadStream("/file", {
276+
start: 1,
277+
end: 3
278+
}).pipe(bl(function(err, data) {
279+
data.toString('utf8').should.be.eql("el");
282280
done();
283-
});
281+
}));
284282
});
285283
it("should propagate errors", function(done) {
286284
var fs = new MemoryFileSystem();

0 commit comments

Comments
 (0)