Skip to content

Commit

Permalink
test: 💍 improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
touv committed Jun 7, 2024
1 parent 87d8d81 commit b6d6365
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/core/test/fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,45 @@ describe('fork)', () => {
.on('error', done)
.on('data', (chunk) => {
assert(typeof chunk === 'object');
assert(typeof chunk['x-request-id'] === 'string');
res += chunk.a;
})
.on('end', () => {
assert.equal(6, res);
done();
});
});
it('#1bis (standalone)', (done) => {
let res = 0;
const script = `
[assign]
path = a
value = 99
`;
from([
{ a: 1, b: 9 },
{ a: 2, b: 9 },
{ a: 1, b: 9 },
{ a: 1, b: 9 },
{ a: 1, b: 9 },
])
.pipe(ezs('fork', {
script,
standalone: true,
target: false,
}))
.pipe(ezs.catch())
.on('error', done)
.on('data', (chunk) => {
assert(typeof chunk === 'object');
res += chunk.a;
})
.on('end', () => {
assert.equal(6, res);
done();
});
});


it('#2', (done) => {
const script = `
Expand Down

0 comments on commit b6d6365

Please sign in to comment.