From 875f71d5f2d9053a5c196d390bc3e0b06e9e5961 Mon Sep 17 00:00:00 2001 From: harttle Date: Sun, 24 Feb 2019 23:08:53 +0800 Subject: [PATCH] chore: a simple liquid_method_missing case for #97 --- test/e2e/drop.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/e2e/drop.ts b/test/e2e/drop.ts index fafec40d9..8ee11a59a 100644 --- a/test/e2e/drop.ts +++ b/test/e2e/drop.ts @@ -9,6 +9,13 @@ describe('drop', function () { beforeEach(function () { engine = new Liquid() }) + it('should support liquid_method_missing', async function () { + let i = 0 + const src = `{{settings.foo}},{{settings.foo}},{{settings.foo}}` + const ctx = { settings: { liquid_method_missing: () => i++ } } + const html = await engine.parseAndRender(src, ctx) + return expect(html).to.equal('0,1,2') + }) it('should test blank strings', async function () { const src = ` {% unless settings.fp_heading == blank %}