feat: add preserveTimezones option

This commit is contained in:
Joonas
2020-12-18 22:03:58 +08:00
committed by Jun Yang
parent 26b217542b
commit d70cd2a1ea
4 changed files with 34 additions and 17 deletions
+5 -4
View File
@@ -1,16 +1,17 @@
import { Liquid } from '../../src/liquid'
import { LiquidOptions } from '../../src/liquid-options'
import { expect } from 'chai'
export const liquid = new Liquid()
export function render (src: string, ctx?: object) {
return liquid.parseAndRender(src, ctx)
export function render (src: string, ctx?: object, opts?: LiquidOptions) {
return liquid.parseAndRender(src, ctx, opts)
}
export async function test (src: string, ctx: object | string, dst?: string) {
export async function test (src: string, ctx: object | string, dst?: string, opts?: LiquidOptions) {
if (dst === undefined) {
dst = ctx as string
ctx = {}
}
return expect(await render(src, ctx as object)).to.equal(dst)
return expect(await render(src, ctx as object, opts)).to.equal(dst)
}