fix: lenientIf not working for the umd bundle, closes #313

This commit is contained in:
harttle
2021-02-19 23:10:15 +08:00
parent 24306722ec
commit 2e66e8b02e
3 changed files with 12 additions and 3 deletions
+9
View File
@@ -1,4 +1,5 @@
import { Liquid } from '../..'
import { Liquid as LiquidUMD } from '../../dist/liquid.browser.umd.js'
import { expect, use } from 'chai'
import * as chaiAsPromised from 'chai-as-promised'
@@ -78,4 +79,12 @@ describe('Issues', function () {
)
expect(html).to.equal('BAR')
})
it('#313 lenientIf not working as expected in umd', async () => {
const engine = new LiquidUMD({
strictVariables: true,
lenientIf: true
})
const html = await engine.parseAndRender(`{{ name | default: "default name" }}`)
expect(html).to.equal('default name')
})
})