Files
buuh/test.js
T

20 lines
495 B
JavaScript
Raw Normal View History

2017-05-24 13:02:33 +02:00
var tape = require('tape')
var html = require('./html')
2017-09-19 19:43:37 +01:00
var raw = require('./html/raw')
2017-05-24 13:02:33 +02:00
var choo = require('./')
tape('should render on the server', function (t) {
var app = choo()
app.route('/', function (state, emit) {
2017-09-19 19:43:37 +01:00
var strong = '<strong>Hello filthy planet</strong>'
2017-05-24 13:02:33 +02:00
return html`
2017-09-19 19:43:37 +01:00
<p>${raw(strong)}</p>
2017-05-24 13:02:33 +02:00
`
})
var res = app.toString('/')
2017-09-19 19:43:37 +01:00
var exp = '<p><strong>Hello filthy planet</strong></p>'
t.equal(res.toString().trim(), exp, 'result was OK')
2017-05-24 13:02:33 +02:00
t.end()
})