Apr 11,2018 at 09:26 am By Ben Hutton
This is an error that I've seen plague several projects when using the Jest Test runner in WebStorm. I have found two working resolutions to this. You can either.
import jsdom from 'jsdom';
const doc = jsdom.jsdom('<!doctype html>test');
global.document = doc;
global.window = doc.defaultView;
Either way the error should now be gone when you run your tests.
Login to Comment
Copyright © 2017 | Ben Hutton