From c35e5948cd61a0085f26d812966efdb51ffbf66d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 29 Jul 2017 23:55:56 -0400 Subject: [PATCH] reuse window object for faster tests --- mocha.opts | 1 - test/helpers.js | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mocha.opts b/mocha.opts index af6b17a845..427b029758 100644 --- a/mocha.opts +++ b/mocha.opts @@ -1,2 +1 @@ ---bail test/test.js \ No newline at end of file diff --git a/test/helpers.js b/test/helpers.js index 2a8e7a6016..01b92e66ce 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -53,9 +53,12 @@ export function tryToReadFile(file) { } } +const { window } = new JSDOM('
'); +global.document = window.document; + export function env() { - const { window } = new JSDOM('
'); - global.document = window.document; + window._svelteTransitionManager = null; + window.document.body.innerHTML = '
'; return window; }