chore: migrate test cases from Chai to Jest

This commit is contained in:
Harttle
2023-03-20 00:41:06 +08:00
committed by Jun Yang
parent dccb90c591
commit c6cde9cd10
97 changed files with 8163 additions and 26440 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Liquid } from '../..'
describe('#evalValue()', function () {
var engine: Liquid
beforeEach(() => { engine = new Liquid({ globals: { foo: 'FOO' } }) })
it('should support boolean', async function () {
const val = await engine.evalValue('true')
expect(val).toBe(true)
})
it('should support binary expression with Context', async function () {
const val = await engine.evalValue('a > b', { a: 1, b: 2 })
expect(val).toBe(false)
})
it('should inherit Liquid options', async function () {
const val = await engine.evalValue('foo')
expect(val).toBe('FOO')
})
})