mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
test cases for #53
This commit is contained in:
+13
-3
@@ -5,19 +5,29 @@ chai.use(require('chai-as-promised'))
|
||||
|
||||
describe('tags/comment', function () {
|
||||
var liquid = Liquid()
|
||||
it('should support comment 1', function () {
|
||||
it('should support empty content', function () {
|
||||
var src = '{% comment %}{% raw%}'
|
||||
return expect(liquid.parseAndRender(src))
|
||||
.to.be.rejectedWith(/{% comment %} not closed/)
|
||||
})
|
||||
it('should support comment 2', function () {
|
||||
it('should ignore plain string', function () {
|
||||
var src = 'My name is {% comment %}super{% endcomment %} Shopify.'
|
||||
return expect(liquid.parseAndRender(src))
|
||||
.to.eventually.equal('My name is Shopify.')
|
||||
})
|
||||
it('should support comment 3', function () {
|
||||
it('should ignore output tokens', function () {
|
||||
var src = '{% comment %}\n{{ foo}} \n{% endcomment %}'
|
||||
return expect(liquid.parseAndRender(src))
|
||||
.to.eventually.equal('')
|
||||
})
|
||||
it('should ignore tag tokens', function () {
|
||||
var src = '{% comment %}{%if true%}true{%else%}false{%endif%}{% endcomment %}'
|
||||
return expect(liquid.parseAndRender(src))
|
||||
.to.eventually.equal('')
|
||||
})
|
||||
it('should ignore un-balenced tag tokens', function () {
|
||||
var src = '{% comment %}{%if true%}true{%else%}false{% endcomment %}'
|
||||
return expect(liquid.parseAndRender(src))
|
||||
.to.eventually.equal('')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user