I'm trying to change the window url in my Jest specs and it throws an error. Not sure if this is an issue with the way that Jest has configured jsdom, or a problem with jsdom. A small example:
import jsdom from 'jsdom';
it('works', () => {
jsdom.changeURL(window, 'https://example.com?foo=butts')
});
I run it like:
$ jest --config config/jest.json spec/js/my_test.js
And get an error:
TypeError: Cannot set property '_URL' of undefined
at Object.<anonymous>.exports.changeURL (node_modules/jsdom/lib/jsdom.js:64:12)
at Object.<anonymous> (spec/js/my_spec.js:6:45)
Not really much in the way of custom configuration on our part when it comes to Jest. Using jsdom@9.9.1 and jest@17.0.3.
I'm trying to change the window url in my Jest specs and it throws an error. Not sure if this is an issue with the way that Jest has configured jsdom, or a problem with jsdom. A small example:
I run it like:
And get an error:
Not really much in the way of custom configuration on our part when it comes to Jest. Using
jsdom@9.9.1andjest@17.0.3.