feat: support layout none, closes #299

This commit is contained in:
harttle
2021-02-12 01:57:30 +08:00
parent 71d5d24813
commit 81e11bb9c4
2 changed files with 15 additions and 2 deletions
+8 -1
View File
@@ -38,9 +38,16 @@ describe('tags/layout', function () {
})
return liquid.renderFile('/parent.html').catch(function (e) {
expect(e.name).to.equal('RenderError')
expect(e.message).to.match(/illegal filename "foo":"undefined"/)
expect(e.message).to.contain('file "foo"("undefined") not available')
})
})
it('should handle layout none', async function () {
const src = '{% layout none %}' +
'{%block a%}A{%endblock%}' +
'B'
const html = await liquid.parseAndRender(src)
return expect(html).to.equal('AB')
})
describe('anonymous block', function () {
it('should handle anonymous block', async function () {
mock({