From e15803fae42b640760fdceff1859e5556002da97 Mon Sep 17 00:00:00 2001 From: harttle Date: Tue, 8 Dec 2020 00:30:32 +0800 Subject: [PATCH] test: fix e2e test --- test/e2e/eval-value-sync.ts | 4 ++-- test/e2e/eval-value.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/e2e/eval-value-sync.ts b/test/e2e/eval-value-sync.ts index 377a57c1c..4650670ed 100644 --- a/test/e2e/eval-value-sync.ts +++ b/test/e2e/eval-value-sync.ts @@ -5,7 +5,7 @@ describe('#evalValueSync()', function () { var engine: Liquid beforeEach(() => { engine = new Liquid() }) - it('should throw when scope undefined', async function () { - return expect(() => engine.evalValueSync('foo', null as any)).to.throw(/context not defined/) + it('should eval value syncly', async function () { + return expect(engine.evalValueSync('true', { opts: {} } as any)).to.equal(true) }) }) diff --git a/test/e2e/eval-value.ts b/test/e2e/eval-value.ts index 9cf84f135..30304dcad 100644 --- a/test/e2e/eval-value.ts +++ b/test/e2e/eval-value.ts @@ -5,7 +5,8 @@ describe('#evalValue()', function () { var engine: Liquid beforeEach(() => { engine = new Liquid() }) - it('should throw when scope undefined', async function () { - return expect(engine.evalValue('"foo"', null as any)).to.be.rejectedWith(/context not defined/) + it('should eval value', async function () { + const val = await engine.evalValue('true', { opts: {} } as any) + expect(val).to.equal(true) }) })