Skip to content

Commit 739b38e

Browse files
committed
test for value forwarding
1 parent bd84d42 commit 739b38e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_jsonl.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,24 @@ unit.add(module, [
294294
async.done();
295295
});
296296

297+
readString('{\n1\n]\n2\n3').pipe(stream);
298+
},
299+
function test_jsonl_transform_errors_forward(t) {
300+
const async = t.startAsync('test_jsonl_transform_errors_forward');
301+
302+
const stream = parser({errorIndicator: (e, val) => val}),
303+
result = [];
304+
305+
stream.on('data', data => result.push(data));
306+
stream.on('error', err => {
307+
eval(t.TEST("!'We shouldn't be here.'"));
308+
async.done();
309+
});
310+
stream.on('end', value => {
311+
eval(t.TEST("t.unify(result, [{key: 0, value: '{'}, {key: 1, value: 1}, {key: 2, value: ']'}, {key: 3, value: 2}, {key:4, value: 3}])"));
312+
async.done();
313+
});
314+
297315
readString('{\n1\n]\n2\n3').pipe(stream);
298316
}
299317
]);

0 commit comments

Comments
 (0)