-
Notifications
You must be signed in to change notification settings - Fork 312
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
jest environment update #2940
jest environment update #2940
Conversation
Hi, Thank you for the effort 😀. I think that might be the same as this https://thymikee.github.io/jest-preset-angular/docs/guides/jsdom-version which was introduced in 14.5 Besides, |
And to make the custom environment solution stand out, we can combine this doc https://thymikee.github.io/jest-preset-angular/docs/guides/jsdom-version/ and this doc https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment into single doc which explains how to set up a test environment for Angular using |
Hello @ahnpnl , the documentation you linked is a bit confusing. If
However, if we are in the first scenarion, although overwriting the testEnvironment configuration option is trivial, it would be that much better (no headaches, no research necessary, etc) for I understand the desire of not releasing breaking changes, however, in this case, i strongly believe that the benefits outweigh the downsides. Is there a scenario where you would consider merging this? If yes, could you give a few details? |
Indeed I notice the doc is a bit confusing, in general We just need to make the doc clearer as 14.5 already deliver OOTB solution like your package |
Then i personally couldn't get it to work. Can you please detail how to do that? |
Ah sorry for the wrong path, it should be About combining doc for test environment, that will be for another PR 😃 |
Cool! I can confirm that the path you provded works. Also |
Summary
With both angular & cdk on v19 there are several issues when running jest unit tests. For more details, please see linked inssue.
Since the jest maintainers refuse to upgrade the jsdom dependency in their published jest environment due to several breaking changes (see #15417, #14891, #14846 & more), i have created a custom jest environment with the latest jsdom package as dependency.
It would be great if jest-preset-angular could support [email protected] out of the box using this package.
Test plan
CI?
Does this PR introduce a breaking change?
Breaking changes are mostly related to how jsdom defines the location object. They are more strictly adhering to the latest standard specification, and as such, the location object is not writeable anymore.
Several workarrounds exist. A quick google should yield results.
Other information