Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Last active July 25, 2016 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeaholicguy/33d7ddf5baf886205ae6f049fe263bbe to your computer and use it in GitHub Desktop.
Save codeaholicguy/33d7ddf5baf886205ae6f049fe263bbe to your computer and use it in GitHub Desktop.
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