Skip to content

Commit

Permalink
Fix test build bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeSheard committed Mar 16, 2017
1 parent 48ebe23 commit 56d117f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/mocha/DOM.js
Expand Up @@ -7,7 +7,7 @@ global.document = jsdom.jsdom("<!doctype html><html><body></body></html>");
global.window = document.defaultView;
global.navigator = global.window.navigator;
global.usingJSDOM = true;
global.HTMLElement = HTMLElement || global.window.HTMLElement;
global.HTMLElement = global.window.HTMLElement;

global.chai = require("chai");
global.expect = global.chai.expect;
Expand All @@ -28,8 +28,12 @@ propagateToGlobal(global.window);
// from mocha-jsdom https://github.com/rstacruz/mocha-jsdom/blob/master/index.js#L80
function propagateToGlobal (window) {
for (var key in window) {
if (!window.hasOwnProperty(key)) continue;
if (key in global) continue;
if (!window.hasOwnProperty(key)) {
continue;
}
if (key in global) {
continue;
}

global[key] = window[key];
}
Expand Down

0 comments on commit 56d117f

Please sign in to comment.