Repository navigation
feat: support JSDOM 27 for @jest/environment-jsdom-abstract - #15834
Conversation
|
|
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
babel-jest
babel-plugin-jest-hoist
babel-preset-jest
create-jest
@jest/diff-sequences
expect
@jest/expect-utils
jest
jest-changed-files
jest-circus
jest-cli
jest-config
@jest/console
@jest/core
@jest/create-cache-key-function
jest-diff
jest-docblock
jest-each
@jest/environment
jest-environment-jsdom
@jest/environment-jsdom-abstract
jest-environment-node
@jest/expect
@jest/fake-timers
@jest/get-type
@jest/globals
jest-haste-map
jest-jasmine2
jest-leak-detector
jest-matcher-utils
jest-message-util
jest-mock
@jest/pattern
jest-phabricator
jest-regex-util
@jest/reporters
jest-resolve
jest-resolve-dependencies
jest-runner
jest-runtime
@jest/schemas
jest-snapshot
@jest/snapshot-utils
@jest/source-map
@jest/test-result
@jest/test-sequencer
@jest/transform
@jest/types
jest-util
jest-validate
jest-watcher
jest-worker
pretty-format
commit: |
a6b0150 to
1b6a313
Compare
1b6a313 to
05da954
Compare
|
Hi, I think I am lacking some jest concepts, because I have no Idea on how to configure jest to use jsdom v27. /**
* @jest-environment jsdom
* @jest-environment-options {"customExportConditions": ["browser"]}
*/
describe("style", () => {
it("treats undefined empty string", () => {
const p = document.createElement("p");
p.style.boxShadow = undefined as unknown as string;
expect(p.style.boxShadow).toBe(""); // works in jsdom@27, but not in v26
});
});{
"type": "module",
"scripts": {
"test": "jest"
},
"devDependencies": {
"@babel/preset-env": "^7.28.3",
"@babel/preset-typescript": "^7.27.1",
"@types/jest": "^30.0.0",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"jsdom": "^27.0.0",
"typescript": "^5.9.3"
}
}Could you please clarify this in the documentation? |
|
Hi @htho I think the doc isn't clear and not updated with concrete example. I put the example how to do it in code wise here https://github.com/jestjs/jest/tree/main/e2e/custom-jsdom-version/v27 Thought technically, it should work with |
|
I just checked |
|
Thank you @ahnpnl I suppose we don't default to JSDOM 27 to not break any existing tests? While the
|
Yes, this is a breaking change
I checked https://www.npmjs.com/package/jest-environment-jsdom?activeTab=code and
I think the supporting for custom export condition is there, just the doc seems to be not clear about example. I would imagine something like I think the doc mentioned about custom export condition only applies to custom environment |
|
Thank you for your time. |
|
Normally I just create PR to update the doc and let maintainers review 😆 |
|
@ahnpnl I'm sorry to bother you, but you seem to have some knowledge about |
|
Please don't use the issue tracker as a support forum. If the docs are unclear, please open up an issue about that (or even better, a PR to clarify) |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Add changes to support JSDOM 27 for
@jest/environment-jsdom-abstractTest plan
Added new e2e tests to cover the change