You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was just going thorugh the docs, setting up the environment for my project.
In section Guides - JSDOM, when using the code provided for the helper script 'setup.js', i ran into 'jsdom('') is not a function' and localStorage SecurityError.
I just wanted to post a workaround that worked for me, in case others run into the same problem:
I was just going thorugh the docs, setting up the environment for my project.
In section Guides - JSDOM, when using the code provided for the helper script 'setup.js', i ran into 'jsdom('') is not a function' and localStorage SecurityError.
I just wanted to post a workaround that worked for me, in case others run into the same problem:
Replace
const jsdom = require('jsdom'),jsdom;
global.document = jsdom('');
with
const jsdom = require('jsdom');
const {JSDOM} = jsdom;
const {document} = (new JSDOM('',{url: "http://localhost"})).window;
global.document = document;
This worked for me :)
The text was updated successfully, but these errors were encountered: