Add test confirming toString() works with min-document elements
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
"insert-css": "^0.2.0",
|
"insert-css": "^0.2.0",
|
||||||
"istanbul": "^0.4.4",
|
"istanbul": "^0.4.4",
|
||||||
"karma-sauce-launcher": "^1.0.0",
|
"karma-sauce-launcher": "^1.0.0",
|
||||||
|
"min-document": "~2.18.0",
|
||||||
"server-router": "^2.1.0",
|
"server-router": "^2.1.0",
|
||||||
"sheetify": "^5.0.0",
|
"sheetify": "^5.0.0",
|
||||||
"standard": "^7.1.0",
|
"standard": "^7.1.0",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const tape = require('tape')
|
const tape = require('tape')
|
||||||
|
const minDocument = require('min-document')
|
||||||
const choo = require('../../')
|
const choo = require('../../')
|
||||||
const view = require('../../html')
|
const view = require('../../html')
|
||||||
|
|
||||||
@@ -16,6 +17,19 @@ tape('should render on the server', function (t) {
|
|||||||
t.equal(html, expected, 'strings are equal')
|
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.test('should accept a state object', function (t) {
|
||||||
t.plan(1)
|
t.plan(1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user