Add test confirming toString() works with min-document elements
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const tape = require('tape')
|
||||
const minDocument = require('min-document')
|
||||
const choo = require('../../')
|
||||
const view = require('../../html')
|
||||
|
||||
@@ -16,6 +17,19 @@ tape('should render on the server', function (t) {
|
||||
t.equal(html, expected, 'strings are equal')
|
||||
})
|
||||
|
||||
t.test('can render without a real DOM', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
const app = choo()
|
||||
app.router((route) => [
|
||||
route('/', () => minDocument.createElement('div'))
|
||||
])
|
||||
|
||||
const html = app.toString('/')
|
||||
const expected = '<div></div>'
|
||||
t.equal(html, expected, 'strings are equal')
|
||||
})
|
||||
|
||||
t.test('should accept a state object', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user