test(e2e): assert constructor filter/tag lookups (node + UMD)

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-05-14 01:44:35 +08:00
co-authored by Cursor
parent bf3a06fe23
commit 56d1fa84f4
+8
View File
@@ -85,6 +85,14 @@ describe('Issues', function () {
expect(Object.getPrototypeOf(umdEngine.filters)).toBeNull()
expect(Object.getPrototypeOf(umdEngine.tags)).toBeNull()
})
it('filter/tag lookups ignore Object.prototype keys unless registered (node + UMD)', async () => {
for (const LiquidClass of [Liquid, LiquidUMD]) {
const engine = new LiquidClass()
await expect(engine.parseAndRender('{{ x | constructor }}', { x: 'OK' })).resolves.toBe('OK')
await expect(new LiquidClass({ strictFilters: true }).parseAndRender('{{ x | constructor }}', { x: 'OK' })).rejects.toThrow(/undefined filter/)
expect(() => engine.parse('{% constructor %}')).toThrow('tag "constructor" not found')
}
})
it('lenientIf not working as expected in umd #313', async () => {
const engine = new LiquidUMD({
strictVariables: true,