Clean up all DOM nodes when tests end
As the test suite grows it's bad for debugging to leak tons of elements onto document.body. In order to concisely append/remove on the tests' "end" event, we need to make sure the root tagName doesn't change. If it does, the `tree` returned from `app.start` will no longer be the root node and the removal fn will throw.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const test = require('tape')
|
||||
const append = require('append-child')
|
||||
const choo = require('../../')
|
||||
const view = require('../../html')
|
||||
|
||||
@@ -55,5 +56,5 @@ test('state is immutable', function (t) {
|
||||
])
|
||||
|
||||
const tree = app.start()
|
||||
document.body.appendChild(tree)
|
||||
t.on('end', append(tree))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user