Skip to content

Commit

Permalink
test: cover parseFilters in template/value.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
harttle committed Mar 5, 2019
1 parent 998832c commit ad0930f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, liquid } from '../../stub/render'

describe('registerFilter', function () {
describe('liquid#registerFilter()', function () {
describe('object arguments', function () {
liquid.registerFilter('obj_test', function () {
return JSON.stringify(arguments)
Expand Down
6 changes: 6 additions & 0 deletions test/unit/template/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ describe('Value', function () {
expect(tpl.filters.length).to.equal(1)
expect(tpl.filters[0].args).to.eql([])
})
it('should parse "foo,foo | add"', function () {
const tpl = new Value('foo,foo | add', false)
expect(tpl.initial).to.equal('foo')
expect(tpl.filters.length).to.equal(1)
expect(tpl.filters[0].args).to.eql([])
})
it('should parse "foo | add: 3, false"', function () {
const tpl = new Value('foo | add: 3, "foo"', false)
expect(tpl.initial).to.equal('foo')
Expand Down

0 comments on commit ad0930f

Please sign in to comment.