mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
perf: introduce AST to avoid reparse
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { expect } from 'chai'
|
||||
import { Context } from '../../../src/context/context'
|
||||
import { Token } from '../../../src/parser/token'
|
||||
import { HTMLToken } from '../../../src/tokens/html-token'
|
||||
import { Render } from '../../../src/render/render'
|
||||
import { HTML } from '../../../src/template/html'
|
||||
import { toThenable } from '../../../src/util/async'
|
||||
@@ -14,7 +14,7 @@ describe('render', function () {
|
||||
describe('.renderTemplates()', function () {
|
||||
it('should render html', async function () {
|
||||
const scope = new Context()
|
||||
const token = { content: '<p>' } as Token
|
||||
const token = { getContent: () => '<p>' } as HTMLToken
|
||||
const html = await toThenable(render.renderTemplates([new HTML(token)], scope))
|
||||
return expect(html).to.equal('<p>')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user