split2
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -106,2 +106,3 @@ /* | ||
options = Object.assign({}, options) | ||
options.transform = transform | ||
@@ -108,0 +109,0 @@ options.flush = flush |
{ | ||
"name": "split2", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "split a Text Stream into a Line Stream, using Stream 3", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
30
test.js
@@ -38,2 +38,18 @@ 'use strict' | ||
test('split four lines on three writes', function (t) { | ||
t.plan(2) | ||
var input = split() | ||
input.pipe(strcb(function (err, list) { | ||
t.error(err) | ||
t.deepEqual(list, ['hello', 'world', 'bye', 'world']) | ||
})) | ||
input.write('hello\nwor') | ||
input.write('ld\nbye\nwo') | ||
input.write('rld') | ||
input.end() | ||
}) | ||
test('accumulate multiple writes', function (t) { | ||
@@ -335,1 +351,15 @@ t.plan(2) | ||
}) | ||
test("don't modify the options object", function (t) { | ||
t.plan(2) | ||
var options = {} | ||
var input = split(options) | ||
input.pipe(strcb(function (err, list) { | ||
t.error(err) | ||
t.same(options, {}) | ||
})) | ||
input.end() | ||
}) |
16256
386
6