exporting bel/raw via choo/html/raw (#565)

This commit is contained in:
Maciej Sitko
2017-09-19 19:43:37 +01:00
committed by GitHub
parent 5a5723561b
commit ef3b372e23
4 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -1,17 +1,19 @@
var tape = require('tape')
var html = require('./html')
var raw = require('./html/raw')
var choo = require('./')
tape('should render on the server', function (t) {
var app = choo()
app.route('/', function (state, emit) {
var strong = '<strong>Hello filthy planet</strong>'
return html`
<p>Hello filthy planet</p>
<p>${raw(strong)}</p>
`
})
var res = app.toString('/')
var exp = '<p>Hello filthy planet</p>'
var exp = '<p><strong>Hello filthy planet</strong></p>'
t.equal(res.toString().trim(), exp, 'result was OK')
t.end()
})