Skip to content

Commit

Permalink
test for value forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
ak--47 committed Aug 18, 2023
1 parent bd84d42 commit 739b38e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_jsonl.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,24 @@ unit.add(module, [
async.done();
});

readString('{\n1\n]\n2\n3').pipe(stream);
},
function test_jsonl_transform_errors_forward(t) {
const async = t.startAsync('test_jsonl_transform_errors_forward');

const stream = parser({errorIndicator: (e, val) => val}),
result = [];

stream.on('data', data => result.push(data));
stream.on('error', err => {
eval(t.TEST("!'We shouldn't be here.'"));
async.done();
});
stream.on('end', value => {
eval(t.TEST("t.unify(result, [{key: 0, value: '{'}, {key: 1, value: 1}, {key: 2, value: ']'}, {key: 3, value: 2}, {key:4, value: 3}])"));
async.done();
});

readString('{\n1\n]\n2\n3').pipe(stream);
}
]);

0 comments on commit 739b38e

Please sign in to comment.