From 60b748845e5e5519acc178fe1b177b6caf881b97 Mon Sep 17 00:00:00 2001 From: Paz Hershberg Date: Wed, 22 May 2024 13:15:49 +0300 Subject: [PATCH] updated test --- test/template.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/template.test.js b/test/template.test.js index 085624c..445eabe 100644 --- a/test/template.test.js +++ b/test/template.test.js @@ -117,7 +117,7 @@ describe('template', () => { expect(result).toBe("https://some.random.url?str=bar&num=1&bool=true&null=null&arr=[\"foo\"]&obj={\"bar\":\"bar\"}"); }); it('testing conditional key', () => { - const json = {}; + const json = { foo: "bar" }; const render = (input) => jq.renderRecursively(json, input); expect(render({'{{empty}}': 'bar'})).toEqual({}); @@ -126,7 +126,7 @@ describe('template', () => { expect(render({'{{\'\'}}': 'bar'})).toEqual({}); expect(render({ "{{spreadValue()}}": { foo: "bar" } })).toEqual({foo: "bar"}); expect(render({ " {{ spreadValue( ) }} ": { foo: "bar" } })).toEqual({foo: "bar"}); - expect(render({ "{{spreadValue()}}": "{{ {foo: \"bar\"} }}" })).toEqual({ foo: "bar" }); + expect(render({ "{{spreadValue()}}": "{{ . }}" })).toEqual({ foo: "bar" }); }); it('recursive templates should work', () => { const json = { foo: 'bar', bar: 'foo' };