mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
feat: support json filter, closes #192
This commit is contained in:
@@ -10,4 +10,10 @@ describe('filters/object', function () {
|
||||
it('true should not use default', () => test('{{true | default: "a"}}', 'true'))
|
||||
it('0 should not use default', () => test('{{0 | default: "a"}}', '0'))
|
||||
})
|
||||
describe('json', function () {
|
||||
it('should stringify string', () => test('{{"foo" | json}}', '"foo"'))
|
||||
it('should stringify number', () => test('{{2 | json}}', '2'))
|
||||
it('should stringify object', () => test('{{obj | json}}', '{"foo":"bar"}'))
|
||||
it('should stringify array', () => test('{{arr | json}}', '[-2,"a"]'))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user