test: fix e2e test

This commit is contained in:
harttle
2020-12-08 00:30:32 +08:00
parent 117673a725
commit e15803fae4
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -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)
})
})
+3 -2
View File
@@ -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)
})
})