jest-preset-angular v8 has breaking changes
See original GitHub issuePlease make sure you have read the submission guidelines before posting an issue
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
- I am running the latest version
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
- I’m reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)
Expected Behavior
Running jest tests does not fail
Current Behavior
Jest tests fail with the following error message:
Module jest-preset-angular/AngularSnapshotSerializer.js in the snapshotSerializers option was not found.
Steps to Reproduce
- update jest-preset-angular to 8.0.0
- run jest tests
Other
I looked into jest-preset-angular and it seems that they introduced a build folder with v8 thus the path is not correct anymore.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:18
- Comments:18 (1 by maintainers)
Top Results From Across the Web
jest-preset-angular/CHANGELOG.md at main - GitHub
BREAKING CHANGES. js files from node_modules are now compiled with esbuild to improve performance. NodeJs range version support now is ...
Read more >jest-preset-angular/CHANGELOG.md - UNPKG
jest -preset-angular/CHANGELOG.md ; 278, ## BREAKING CHANGES ; 279 ; 280, * Drop support for Angular < **9.0**, see https://angular.io/guide/releases#support-policy ...
Read more >jest-preset-angular - npm
A preset of Jest configuration for Angular projects. Build Status NPM Version GitHub license. Our online documentation is available at https:// ...
Read more >jest-preset-angular | Yarn - Package Manager
BREAKING CHANGES · Since Angular 11, the minimum version of zone. · Now we are using Angular AST transformers, reflect-metadata is not needed...
Read more >https://raw.githubusercontent.com/thymikee/jest-pr...
[12.2.3](https://github.com/thymikee/jest-preset-angular/compare/v12.2.2...v12.2.3) ... BREAKING CHANGES * **NodeJs** range version support now is `^12.20.0 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@leon I managed to fix it by changing
jest-preset-angular/AngularSnapshotSerializer.jstojest-preset-angular/build/AngularSnapshotSerializer.jsandjest-preset-angular/HTMLCommentSerializer.jstojest-preset-angular/build/HTMLCommentSerializer.js.Since in latest version of jest they have been moved under
/builddirectory. REF: https://github.com/thymikee/jest-preset-angular/releases/tag/v8.0.0in your module, you may have the file jest.config.js with the following content.
comment or remove the member “snapshotSerializers”. It is not needed. Worked for me, The resulting should be