mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-17 05:10:40 -07:00
test: cases for async variables
This commit is contained in:
@@ -142,4 +142,10 @@ describe('tags/if', function () {
|
||||
const html = liquid.parseAndRenderSync(src, scope)
|
||||
return expect(html).to.equal('true')
|
||||
})
|
||||
it('should support async variables', async () => {
|
||||
const src = `{%if var == 'var' %}success{%endif%}`
|
||||
const scope = { 'var': Promise.resolve('var') }
|
||||
const html = await liquid.parseAndRender(src, scope)
|
||||
return expect(html).to.equal('success')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user