mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix: type compatible with v9 tag definition, support Context as scope in various render APIs, #570
This commit is contained in:
@@ -57,6 +57,10 @@ describe('Liquid', function () {
|
||||
const html = await engine.parseAndRender(src, { foo: Promise.resolve('FOO') })
|
||||
expect(html).to.equal('FOO')
|
||||
})
|
||||
it('should parse and render with Context', async function () {
|
||||
const html = await engine.parseAndRender('{{foo}}', new Context({ foo: 'FOO' }))
|
||||
expect(html).to.equal('FOO')
|
||||
})
|
||||
})
|
||||
describe('#parseAndRenderSync', function () {
|
||||
const engine = new Liquid()
|
||||
@@ -145,6 +149,11 @@ describe('Liquid', function () {
|
||||
const str = await engine.evalValue('"foo"', ctx)
|
||||
expect(str).to.equal('foo')
|
||||
})
|
||||
it('should support plain scope', async function () {
|
||||
const engine = new Liquid()
|
||||
const str = await engine.evalValue('foo', { foo: 'FOO' })
|
||||
expect(str).to.equal('FOO')
|
||||
})
|
||||
})
|
||||
describe('#evalValueSync', function () {
|
||||
it('should eval string literal', function () {
|
||||
|
||||
Reference in New Issue
Block a user