Skip to content

Instantly share code, notes, and snippets.

Last active Jul 25, 2016
What would you like to do?
import React from 'react';
import {expect} from 'chai';
import jsdom from 'jsdom';
const document = jsdom.jsdom('<!doctype html><html><body></body></html>');
const window = document.defaultView;
global.document = document;
global.window = window;
Object.keys(window).forEach((key) => {
if (!(key in global)) {
global[key] = window[key];
global.React = React;
global.expect = expect;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment