From 2853e98546568a17530e12abe460daeaab96e8bb Mon Sep 17 00:00:00 2001 From: Luca Greco Date: Wed, 12 Oct 2016 02:03:25 +0200 Subject: [PATCH] fix: the test jsdom window doesn't need to be in the shared global. --- test/setup.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/setup.js b/test/setup.js index e17c9db..de6055c 100644 --- a/test/setup.js +++ b/test/setup.js @@ -17,14 +17,13 @@ const BROWSER_POLYFILL_PATH = "./dist/browser-polyfill.js"; // Create the jsdom window used to run the tests const testDOMWindow = jsdom("", {virtualConsole}).defaultView; -global.window = testDOMWindow; // 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 // render in the reports. after(() => { - if (global.window && process.env.COVERAGE == "y") { - global.__coverage__ = global.window.__coverage__; + if (testDOMWindow && process.env.COVERAGE == "y") { + global.__coverage__ = testDOMWindow.__coverage__; } });