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

Different snapshot in coverage mode #1209

Open
adi-zz opened this issue Apr 16, 2019 · 2 comments
Open

Different snapshot in coverage mode #1209

adi-zz opened this issue Apr 16, 2019 · 2 comments

Comments

@adi-zz
Copy link

adi-zz commented Apr 16, 2019

Version

1.0.0-beta.29

Reproduction link

https://github.com/adi-zz/istanbul-snapshot-in-coverage-mode

Steps to reproduce

npm i

npm run test

What is expected?

npm run test generates 2 snapshots, for the same component. The 2 generated snapshots are logged in the console when running npm run test. The 2 generated snapshots should be identical.

What is actually happening?

When running jest in 'normal' mode, the generated snapshot is <div><h1>parent</h1> <child-stub items="1,string,() => true"></child-stub></div> (as expected).

When running in jest 'coverage' mode, the generated snapshot is <div><h1>parent</h1> <child-stub items="1,string,() => { /* istanbul ignore next */ cov_13kzki4jl6.f[2] ; cov_13kzki4jl6.s[7] ; return true; }"></child-stub></div>. For this reason, running jest in coverage mode will fail, because the snapshot is different.


Maybe the issue is related to #975.

@eddyerburgh
Copy link
Member

This issue will be fixed when #975 is implemented

@KaiFuglem
Copy link

Is this fixed now that #1834 has been merged?

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

No branches or pull requests

3 participants