Skip to content

Commit

Permalink
updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
pazhersh committed May 22, 2024
1 parent 9bd5ac5 commit 60b7488
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({});
Expand All @@ -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' };
Expand Down

0 comments on commit 60b7488

Please sign in to comment.