mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 06:20: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:
@@ -76,15 +76,12 @@ describe('tags/render', function () {
|
||||
})
|
||||
|
||||
it('should be able to access globals', async function () {
|
||||
liquid = new Liquid({ root: '/', extname: '.html', globals: { name: 'Harttle' } })
|
||||
mock({
|
||||
'/hash.html': 'InParent: {{name}} {% render "user.html" %}',
|
||||
'/user.html': 'InChild: {{name}}'
|
||||
})
|
||||
const html = await liquid.renderFile('hash.html', {
|
||||
name: 'harttle'
|
||||
}, {
|
||||
globals: { name: 'Harttle' }
|
||||
})
|
||||
const html = await liquid.renderFile('hash', { name: 'harttle' })
|
||||
expect(html).to.equal('InParent: harttle InChild: Harttle')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user