Closed k4y4k closed 3 years ago
could you please provide code samples or a link to the repo
I believe I have the same issue. Here's a small repo to reproduce: https://github.com/lukasvan3l/jest-image-snapshot-invalid-snapshot
I'm getting a different errormessage because I set runInProcess: true
in the config.
First round:
➜ jest-image-snapshot-invalid-snapshot git:(main) ✗ npm t
> jest-image-snapshot-invalid-snapshot@1.0.0 test
> jest
PASS tests/compare-png.test.js
compare
✓ should snapshot my png (4 ms)
› 1 snapshot written.
Snapshot Summary
› 1 snapshot written from 1 test suite.
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 1 written, 1 total
Time: 0.536 s, estimated 1 s
Ran all test suites.
Second round:
➜ jest-image-snapshot-invalid-snapshot git:(main) ✗ npm t
> jest-image-snapshot-invalid-snapshot@1.0.0 test
> jest
FAIL tests/compare-png.test.js
compare
✕ should snapshot my png (6 ms)
● compare › should snapshot my png
Invalid file signature
1 | describe('compare', () => {
2 | it('should snapshot my png', () => {
> 3 | expect('huis-aan-huis-1-2.png').toMatchImageSnapshot();
| ^
4 | })
5 | })
6 |
at Object.<anonymous>.module.exports.Object.<anonymous>.Parser._parseSignature (node_modules/pngjs/lib/parser.js:53:18)
at Object.<anonymous> (tests/compare-png.test.js:3:37)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 0.561 s, estimated 1 s
Ran all test suites.
The snapshot that is created is a whopping 21 bytes, that can't be right...
could you please provide code samples or a link to the repo
Unfortunately it's a private project. I did eventually implement visual diffing, but I'm not sure what I did that made it work or if I'm even using this plugin anymore 🤔
Forgot to close this, anyway, so apologies for that.
howdy :wave:
First time using this. My snapshots generate OK but they won't test - if the snapshot exists,
toMatchSnapshot()
throws:Any ideas?