Getting "Cannot read property 'some' of undefined" when running tests
🐛 Bug Report
Running jest when jsdom@16.2.2 is installed results in the error:
TypeError: Cannot read property 'some' of undefined
at Object.exports.install (node_modules/whatwg-url/dist/URL.js:84:20)
To Reproduce
Steps to reproduce the behavior:
Install jest, but make sure the jsdom pulled in by jest-environment-jsdom is 16.2.2.
$ npm ls jsdom
jest-repro@1.0.0 /Users/bschlenk/Code/jest-repro
└─┬ jest@26.4.2
└─┬ @jest/core@26.4.2
└─┬ jest-config@26.4.2
└─┬ jest-environment-jsdom@26.3.0
└── jsdom@16.2.2
FWIW, tests seem to pass when jsdom@16.4.0 is used, but jest-environment-jsdom has the version set to ^16.2.2.
Expected behavior
Tests should work and pass.
Link to repl or repo (highly encouraged)
https://github.com/bschlenk/jest-some-repro
envinfo
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.21.1 - ~/.yarn/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.16.1/bin/npm
npmPackages:
jest: ^26.4.2 => 26.4.2