Different snapshot with --coverage
See original GitHub issueI am currently using jest-preset-angular@7.0.0-alpha.2 and our CI builds started to failing due to different snapshot when using jest with --coverage
:
- ng-reflect-product-filter="function (product) { return pr"
+ ng-reflect-product-filter="function (product) {
+ "
This started to happend when I upgraded to version 7 which uses ts-jest. Not sure who is responsible for serializing components. There is similar issue, but I don’t see anything related to istanbul in my snapshot.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Snapshot Testing - Jest
Also, rendering the same component with different props in other snapshot tests will not affect the first one, as the tests don't know...
Read more >Different snapshot in coverage mode #1209 - GitHub
When running in jest 'coverage' mode, the generated snapshot is <div><h1>parent</h1> <child-stub items="1,string,() => { /* istanbul ignore next ...
Read more >Why jest snapshots can be harmful — practical examples
The snapshot file is long, with a lot of HTML code, and the coverage report doesn't reveal any issues. Let's look at another...
Read more >Snapshot | Guide - Vitest
Learn Snapshot by video from Vue School. Snapshot tests are a very useful tool whenever you want to make sure the output of...
Read more >Creating snapshots in Jest for testing React applications
The following image illustrates the process of snapshot testing in Jest. It shows the different outcomes when a snapshot passes, ...
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
@thymikee this was just simplest example i could think of. In my real setup i don’t serialize the function to html directly, but it is an
@Input
to other component and serialization is just side effect. It looks something like this:Current behaviour doesn’t allow to snapshot test a component which uses some other component with function
@Input
s when used together with coverage. There are currently component libraries out there which use functions as inputs.I’ll try to write the serializer and see how far i can get 😉
@Ludevik always learning, that’s the attitude! I could’ve at least pushed the tag but forgot about it as I made a release during my time off 😅