mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
refactor: remove mock-fs from dev dependency
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { expect } from 'chai'
|
||||
import Scope from 'src/scope/scope'
|
||||
import Token from 'src/parser/token'
|
||||
import Tag from 'src/template/tag/tag'
|
||||
import Filter from 'src/template/filter'
|
||||
import Render from 'src/render/render'
|
||||
import HTML from 'src/template/html'
|
||||
|
||||
describe('render', function () {
|
||||
let render
|
||||
before(function () {
|
||||
Filter.clear()
|
||||
Tag.clear()
|
||||
render = new Render()
|
||||
})
|
||||
|
||||
describe('.renderTemplates()', function () {
|
||||
it('should throw when scope undefined', function () {
|
||||
expect(render.renderTemplates([])).to.be.rejectedWith(/scope undefined/)
|
||||
})
|
||||
|
||||
it('should render html', async function () {
|
||||
const scope = new Scope()
|
||||
const token = { type: 'html', value: '<p>' } as Token
|
||||
const html = await render.renderTemplates([new HTML(token)], scope)
|
||||
return expect(html).to.equal('<p>')
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user