I'm currently using jsdom
as my jest environment, with jest-environment-jsdom
installed.
// jest.config.js
module.exports = {
...
"testEnvironment": "jsdom"
}
// package.json
{
"dependencies": {
"jest": "29.6.2",
"jest-environment-jsdom": "29.6.2"
}
}
However, jest-environment-jsdom
does not use the latest version of jsdom
— currently it lists v20 while jsdom
is up to v26.
I'm getting console errors when running jest about unsupported CSS (see ). This is fixed in [email protected]
.
Is there any supported way to use a specified version of jsdom
in jest
?
My current workaround is with pnpm
overrides:
// package.json
{
"pnpm": {
"overrides": {
"jest-environment-jsdom>jsdom": "^24.1.0"
}
},
}