From 81c7ccf0e934a861a2c018be7e784375383e5a25 Mon Sep 17 00:00:00 2001 From: Nicolas Thouvenin Date: Wed, 19 Jun 2024 16:39:14 +0200 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20add=20new=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/test/ezs.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/core/test/ezs.js b/packages/core/test/ezs.js index dff5199c..20c8acc1 100644 --- a/packages/core/test/ezs.js +++ b/packages/core/test/ezs.js @@ -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 = `