1 | var test = require('tape')
|
2 | var jsdom
|
3 |
|
4 | test('jsdom', function (t) {
|
5 | jsdom = require('./index')()
|
6 | t.end()
|
7 | })
|
8 |
|
9 | test('dom', function (t) {
|
10 | var div = document.createElement('div')
|
11 | div.innerHTML = 'hello'
|
12 | document.body.appendChild(div)
|
13 | t.equal(document.querySelector('body').innerHTML, '<div>hello</div>', 'dom works')
|
14 | t.end()
|
15 | })
|
16 |
|
17 | test('cleanup', function (t) {
|
18 | jsdom()
|
19 | t.ok(typeof global.document === 'undefined', 'cleaned document')
|
20 | t.ok(typeof global.alert === 'undefined', 'cleaned alert')
|
21 | t.end()
|
22 | })
|