add support for hyperscript in choo.toString (#635)
* add failing test for hyperscript (#634) * add support for hyperscript in choo.toString (#634)
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
var tape = require('tape')
|
||||
var h = require('hyperscript')
|
||||
|
||||
var html = require('./html')
|
||||
var raw = require('./html/raw')
|
||||
var choo = require('./')
|
||||
|
||||
tape('should render on the server', function (t) {
|
||||
tape('should render on the server with bel', function (t) {
|
||||
var app = choo()
|
||||
app.route('/', function (state, emit) {
|
||||
var strong = '<strong>Hello filthy planet</strong>'
|
||||
@@ -17,3 +18,14 @@ tape('should render on the server', function (t) {
|
||||
t.equal(res.toString().trim(), exp, 'result was OK')
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('should render on the server with hyperscript', function (t) {
|
||||
var app = choo()
|
||||
app.route('/', function (state, emit) {
|
||||
return h('p', h('strong', 'Hello filthy planet'))
|
||||
})
|
||||
var res = app.toString('/')
|
||||
var exp = '<p><strong>Hello filthy planet</strong></p>'
|
||||
t.equal(res.toString().trim(), exp, 'result was OK')
|
||||
t.end()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user