Skip to content

Instantly share code, notes, and snippets.

@chrisjlee
Created September 6, 2017 15:43
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 chrisjlee/0e8cd4da1d2d59a70635eace92a22994 to your computer and use it in GitHub Desktop.
Save chrisjlee/0e8cd4da1d2d59a70635eace92a22994 to your computer and use it in GitHub Desktop.
Error: It looks like you called `mount()` without a global document being loaded.

Problem:

Error: It looks like you called mount() without a global document being loaded.

Solution

use Jsdom to create a global document enzymejs/enzyme#341

import jsdom from 'jsdom';
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>');
global.document = doc;
global.window = doc.defaultView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment