mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 00:55:13 -07:00
refactor: mv custom filter test
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
import { test, liquid } from '../../../stub/render'
|
|
||||||
|
|
||||||
describe('filters/custom', function () {
|
|
||||||
liquid.registerFilter('obj_test', function () {
|
|
||||||
return JSON.stringify(arguments)
|
|
||||||
})
|
|
||||||
it('should support object', () => test(
|
|
||||||
`{{ "a" | obj_test: k1: "v1", k2: foo }}`,
|
|
||||||
'{"0":"a","1":["k1","v1"],"2":["k2","bar"]}'
|
|
||||||
))
|
|
||||||
it('should support mixed object', () => test(
|
|
||||||
`{{ "a" | obj_test: "something", k1: "v1", k2: foo }}`,
|
|
||||||
'{"0":"a","1":"something","2":["k1","v1"],"3":["k2","bar"]}'
|
|
||||||
))
|
|
||||||
})
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { test, liquid } from '../../stub/render'
|
||||||
|
|
||||||
|
describe('registerFilter', function () {
|
||||||
|
describe('object arguments', function () {
|
||||||
|
liquid.registerFilter('obj_test', function () {
|
||||||
|
return JSON.stringify(arguments)
|
||||||
|
})
|
||||||
|
it('should support object', () => test(
|
||||||
|
`{{ "a" | obj_test: k1: "v1", k2: foo }}`,
|
||||||
|
'{"0":"a","1":["k1","v1"],"2":["k2","bar"]}'
|
||||||
|
))
|
||||||
|
it('should support mixed object', () => test(
|
||||||
|
`{{ "a" | obj_test: "something", k1: "v1", k2: foo }}`,
|
||||||
|
'{"0":"a","1":"something","2":["k1","v1"],"3":["k2","bar"]}'
|
||||||
|
))
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user