mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
17 lines
419 B
TypeScript
17 lines
419 B
TypeScript
import { Liquid } from '../../src/liquid'
|
|
import { expect } from 'chai'
|
|
|
|
export const liquid = new Liquid()
|
|
|
|
export function render (src: string, ctx?: object) {
|
|
return liquid.parseAndRender(src, ctx)
|
|
}
|
|
|
|
export async function test (src: string, ctx: object | string, dst?: string) {
|
|
if (dst === undefined) {
|
|
dst = ctx as string
|
|
ctx = {}
|
|
}
|
|
return expect(await render(src, ctx as object)).to.equal(dst)
|
|
}
|