fix: the test jsdom window doesn't need to be in the shared global.

This commit is contained in:
Luca Greco 2016-10-12 02:03:25 +02:00
parent 6cca044a5c
commit 2853e98546
1 changed files with 2 additions and 3 deletions

View File

@ -17,14 +17,13 @@ const BROWSER_POLYFILL_PATH = "./dist/browser-polyfill.js";
// Create the jsdom window used to run the tests // Create the jsdom window used to run the tests
const testDOMWindow = jsdom("", {virtualConsole}).defaultView; const testDOMWindow = jsdom("", {virtualConsole}).defaultView;
global.window = testDOMWindow;
// Copy the code coverage of the browser-polyfill script from the jsdom window // Copy the code coverage of the browser-polyfill script from the jsdom window
// to the nodejs global, where nyc expects to find the code coverage data to // to the nodejs global, where nyc expects to find the code coverage data to
// render in the reports. // render in the reports.
after(() => { after(() => {
if (global.window && process.env.COVERAGE == "y") { if (testDOMWindow && process.env.COVERAGE == "y") {
global.__coverage__ = global.window.__coverage__; global.__coverage__ = testDOMWindow.__coverage__;
} }
}); });