Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add custom jsdom env #2904

Merged
merged 1 commit into from
Dec 20, 2024
Merged

feat: add custom jsdom env #2904

merged 1 commit into from
Dec 20, 2024

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Dec 19, 2024

Summary

See commits

Closes #2883

Test plan

Green CI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

N.A.

@ahnpnl ahnpnl requested a review from Copilot December 19, 2024 21:10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 18 changed files in this pull request and generated no comments.

Files not reviewed (11)
  • .npmignore: Language not supported
  • e2e/custom-jsdom-env/foo.component.html: Language not supported
  • e2e/custom-jsdom-env/foo.component.scss: Language not supported
  • e2e/custom-jsdom-env/tsconfig-cjs.spec.json: Language not supported
  • e2e/custom-jsdom-env/tsconfig-esm.spec.json: Language not supported
  • package.json: Language not supported
  • src/environments/jest-env-jsdom-abstract.ts: Evaluated as low risk
  • src/environments/jest-jsdom-env.spec.ts: Evaluated as low risk
  • src/environments/jest-jsdom-env.ts: Evaluated as low risk
  • environments/jest-jsdom-env.js: Evaluated as low risk
  • e2e/custom-jsdom-env/foo.component.ts: Evaluated as low risk
@ahnpnl ahnpnl force-pushed the feat/custom-jsdom-version branch from d3b7c08 to d2a7993 Compare December 19, 2024 21:54
This environment is a copy of `jest-environment-jsdom` which allows end users to decide which version of `jsdom` they would like to use in their project
@ahnpnl ahnpnl force-pushed the feat/custom-jsdom-version branch from d2a7993 to c96c1b0 Compare December 19, 2024 22:04
@ahnpnl ahnpnl marked this pull request as ready for review December 20, 2024 09:51
@ahnpnl ahnpnl merged commit 6045a96 into main Dec 20, 2024
12 checks passed
@ahnpnl ahnpnl deleted the feat/custom-jsdom-version branch December 20, 2024 09:52
@Delagen
Copy link

Delagen commented Jan 21, 2025

@ahnpnl Can we make jest-environment-jsdom package optional now? Because if we use custom environment provided by you package we only need to install jsdom package.

@ahnpnl
Copy link
Collaborator Author

ahnpnl commented Jan 21, 2025

Ya I think jest-environment-jsdom can be an optional peer dep. However, marking it as optional now is like a breaking change. I would reserve that change for the next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Tests fail with ReferenceError: document is not defined on Angular 19
2 participants