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
+2 -3
View File
@@ -1,6 +1,5 @@
import { Liquid } from '../../src/liquid'
import { LiquidOptions } from '../../src/liquid-options'
import { expect } from 'chai'
export const liquid = new Liquid()
@@ -15,6 +14,6 @@ export async function test (src: string, ctx: object | string, expected?: string
}
const engine = opts ? new Liquid(opts) : liquid
const result = await engine.parseAndRender(src, ctx as object)
if (expected instanceof RegExp) return expect(result).to.match(expected)
return expect(result).to.equal(expected)
if (expected instanceof RegExp) return expect(result).toMatch(expected)
return expect(result).toBe(expected)
}