feat: add option for keeping variable type in output

This commit is contained in:
Alex de Wergifosse
2020-12-16 10:20:10 +08:00
committed by Jun Yang
parent e84fbf32ad
commit cd92e77726
11 changed files with 42 additions and 21 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ import { Context } from '../../../src/context/context'
import { HTMLToken } from '../../../src/tokens/html-token'
import { Render } from '../../../src/render/render'
import { HTML } from '../../../src/template/html'
import { Emitter } from '../../../src/render/emitter'
import { toThenable } from '../../../src/util/async'
describe('render', function () {
@@ -15,7 +16,7 @@ describe('render', function () {
it('should render html', async function () {
const scope = new Context()
const token = { getContent: () => '<p>' } as HTMLToken
const html = await toThenable(render.renderTemplates([new HTML(token)], scope))
const html = await toThenable(render.renderTemplates([new HTML(token)], scope, new Emitter(scope.opts.keepOutputType)))
return expect(html).to.equal('<p>')
})
})