perf: parse filenames in parse() insteadof render()

This commit is contained in:
harttle
2021-09-30 22:15:09 +08:00
committed by Jun Yang
parent 24f5346084
commit 8273c17dab
13 changed files with 80 additions and 68 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ describe('tags/include', function () {
})
return liquid.renderFile('/parent.html').catch(function (e) {
expect(e.name).to.equal('RenderError')
expect(e.message).to.match(/illegal filename "not-exist"/)
expect(e.message).to.match(/illegal filename "undefined"/)
})
})
+1 -1
View File
@@ -38,7 +38,7 @@ describe('tags/layout', function () {
})
return liquid.renderFile('/parent.html').catch(function (e) {
expect(e.name).to.equal('RenderError')
expect(e.message).to.contain('file "foo"("undefined") not available')
expect(e.message).to.contain('illegal filename "undefined"')
})
})
it('should handle layout none', async function () {
+1 -1
View File
@@ -44,7 +44,7 @@ describe('tags/render', function () {
})
return liquid.renderFile('/parent.html').catch(function (e) {
expect(e.name).to.equal('RenderError')
expect(e.message).to.match(/illegal filename "not-exist":"undefined"/)
expect(e.message).to.match(/illegal filename "undefined"/)
})
})