mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 14:30:38 -07:00
perf: improve performance by 4x by simplified parseFile
- previously deprecated `getTemplate()` and `getTemplateSync()` not no longer supported - `opts` no longer support dynamic set in `parseFile()`, `renderFile()` arguments
This commit is contained in:
@@ -91,7 +91,7 @@ describe('Liquid', function () {
|
||||
root: ['/root/'],
|
||||
extname: '.html'
|
||||
})
|
||||
const tpls = await engine.getTemplate('mocha')
|
||||
const tpls = await engine.parseFileSync('mocha')
|
||||
expect(tpls.length).to.gte(1)
|
||||
expect(tpls[0].token.getText()).to.contain('module.exports')
|
||||
})
|
||||
@@ -126,7 +126,7 @@ describe('Liquid', function () {
|
||||
root: ['/boo', '/root/'],
|
||||
extname: '.html'
|
||||
})
|
||||
return expect(() => engine.getTemplateSync('/not/exist.html'))
|
||||
return expect(() => engine.parseFileSync('/not/exist.html'))
|
||||
.to.throw(/Failed to lookup "\/not\/exist.html" in "\/boo,\/root\/"/)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user