docs: website for LiquidJS

This commit is contained in:
harttle
2020-03-28 17:21:07 +08:00
parent 0633dbeabb
commit 3e42d6b1b0
422 changed files with 14509 additions and 50335 deletions
+8
View File
@@ -27,6 +27,14 @@ describe('tags/cycle', function () {
return expect(html).to.equal('1e1e1')
})
it('should considered different groups for different arguments', async function () {
const src = "{% cycle '1', '2', '3'%}" +
"{% cycle '1', '2'%}" +
"{% cycle '1', '2', '3'%}"
const html = await liquid.parseAndRender(src)
return expect(html).to.equal('112')
})
it('should support cycle group', async function () {
const src = "{% cycle one: '1', '2', '3'%}" +
"{% cycle 1: '1', '2', '3'%}" +
+5 -1
View File
@@ -25,10 +25,14 @@ describe('drop/drop', function () {
return key.toUpperCase()
}
}
it('should call corresponding method', async function () {
it('should call corresponding method when output', async function () {
const html = await liquid.parseAndRender(`{{obj.getName}}`, { obj: new CustomDrop() })
expect(html).to.equal('GET NAME')
})
it('should call corresponding method when expression evaluates', async function () {
const html = await liquid.parseAndRender(`{% if obj.getName == "GET NAME" %}true{% endif %}`, { obj: new CustomDrop() })
expect(html).to.equal('true')
})
it('should read corresponding property', async function () {
const html = await liquid.parseAndRender(`{{obj.name}}`, { obj: new CustomDrop() })
expect(html).to.equal('NAME')