Files
liquidjs/test/stub/render.ts
T
harttle b4acdb463a fix: math filters now return number, resolves #110
* fix linting
* numbers are no longer fixed:
    i.e. {{0.3 | minus 0.1}} now renders as 0.19999
    Stick to JavaScript number behavior, see: 8.0.0
2019-02-28 13:02:51 +08:00

19 lines
427 B
TypeScript

import Liquid from '../../src/liquid'
import { expect } from 'chai'
export const liquid = new Liquid()
export const ctx = {
date: new Date(),
foo: 'bar',
arr: [-2, 'a'],
obj: { foo: 'bar' },
func: function () {},
posts: [{ category: 'foo' }, { category: 'bar' }]
}
export async function test (src: string, dst: string) {
const html = await liquid.parseAndRender(src, ctx)
return expect(html).to.equal(dst)
}