File tree Expand file tree Collapse file tree 3 files changed +220
-95
lines changed Expand file tree Collapse file tree 3 files changed +220
-95
lines changed Original file line number Diff line number Diff line change 11'use strict'
22
33const chai = require ( 'chai' )
4- const jsdom = require ( 'jsdom' ) . jsdom
4+ const { JSDOM } = require ( 'jsdom' )
55const sinonChai = require ( 'sinon-chai' )
66
7- // http://airbnb.io/enzyme/docs/guides/jsdom.html
8- global . document = jsdom ( '' )
7+ const dom = new JSDOM ( `<!DOCTYPE html>` )
8+
9+ global . window = dom . window
10+ global . document = dom . window . document
911global . document . createRange = ( ) => ( {
1012 commonAncestorContainer : global . document . body ,
1113 setStart ( ) { } ,
1214 setEnd ( ) { } ,
1315} )
14- global . window = document . defaultView
15- Object . keys ( document . defaultView ) . forEach ( ( property ) => {
16- if ( typeof global [ property ] === 'undefined' ) {
17- global [ property ] = document . defaultView [ property ]
18- }
19- } )
2016global . navigator = {
2117 userAgent : 'node.js' ,
2218 appVersion : { indexOf ( ) { } } ,
You can’t perform that action at this time.
0 commit comments