Skip to content

Commit

Permalink
test: 💍 add new test
Browse files Browse the repository at this point in the history
  • Loading branch information
touv committed Jun 19, 2024
1 parent 44bdd31 commit 81c7ccf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/core/test/ezs.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,34 @@ describe('Build a pipeline', () => {
done();
});
});
it('with assign non object value', (done) => {
let res = 0;
const commands = `
# My first ezs script
title = FOR TEST
description = set local or global
[assign]
path = val.ue
value = get('val')
`;
const ten = new Decade();
ten
.pipe(ezs((input, output, ctx) => {
if (ctx.isLast()) {
return output.close();
}
return output.send({ val: input });
}))
.pipe(ezs('delegate', { script: commands }))
.on('data', (chunk) => {
res = chunk;
})
.on('end', () => {
assert.strictEqual(res.val.ue, 9);
done();
});
});
it('with assign(multi) script pipeline', (done) => {
let res = 0;
const commands = `
Expand Down

0 comments on commit 81c7ccf

Please sign in to comment.