import jsdom from 'jsdom'; import chai from 'chai'; import sinonChai from 'sinon-chai'; // Jsdom document & window const doc = jsdom.jsdom(''); const win = doc.defaultView; // Add to global global.document = doc; global.window = win; // Add window keys to global window Object.keys(window).forEach((key) => { if (!(key in global)) { global[key] = window[key]; } }); chai.expect(); chai.use(sinonChai);