mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
feat: renderSync, parseAndRenderSync and renderFileSync, see #48
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import * as chai from 'chai'
|
||||
import { Hash } from '../../../src/template/tag/hash'
|
||||
import { Context } from '../../../src/context/context'
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
describe('Hash', function () {
|
||||
it('should parse variable', async function () {
|
||||
const hash = await Hash.create('num:foo', new Context({ foo: 3 }))
|
||||
expect(hash.num).to.equal(3)
|
||||
})
|
||||
it('should parse literals', async function () {
|
||||
const hash = await Hash.create('num:3', new Context())
|
||||
expect(hash.num).to.equal(3)
|
||||
})
|
||||
it('should support sync', function () {
|
||||
const hash = Hash.createSync('num:3', new Context())
|
||||
expect(hash.num).to.equal(3)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user