Browse Source

Don't clone the jsdom config object unnecessarily (#13)

Fixes #11
pull/14/head
Josh Duff 7 years ago
committed by Luke Childs
parent
commit
7db9e23e6c
  1. 4
      src/index.js

4
src/index.js

@ -4,10 +4,8 @@ const { JSDOM } = require('jsdom');
// Class to return a window instance.
// Accepts a jsdom config object.
// Config object must be cloned before passing through otherwise jsdom will add
// lots of properties to the original reference.
module.exports = class Window {
constructor(jsdomConfig) {
return (new JSDOM('', Object.assign({}, jsdomConfig))).window;
return (new JSDOM('', jsdomConfig)).window;
}
};

Loading…
Cancel
Save