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

Snapshot is doubly-escaped / hard to see diffs #1254

Closed
ochafik opened this issue Feb 9, 2017 · 3 comments · Fixed by #1317
Closed

Snapshot is doubly-escaped / hard to see diffs #1254

ochafik opened this issue Feb 9, 2017 · 3 comments · Fixed by #1317
Labels
bug current functionality does not work as desired

Comments

@ochafik
Copy link

ochafik commented Feb 9, 2017

The example from the readme gives:

exports[`HelloWorld component 1`] = `"\"\\n<h1>\\n    Hello World...!\\n</h1>\\n\""`;

(looks like it's json-stringified, with extra " quotes)

I'd love to use the snapshot feature, but non-diffable snapshots are a no-go. Could the exported value not just be a json object instead of a stringified json object?

@novemberborn
Copy link
Member

Could the exported value not just be a json object instead of a stringified json object?

Yes, that's what #1223 is aiming to do.

@ochafik
Copy link
Author

ochafik commented Feb 10, 2017

Awesome, thanks!

@novemberborn novemberborn added the bug current functionality does not work as desired label Feb 17, 2017
@novemberborn
Copy link
Member

Please see #1275 for context.

jhnns added a commit to peerigon/webpack-universal-dev-server that referenced this issue Feb 28, 2017
There are still issues with snapshotting and ava, see avajs/ava#1254
novemberborn added a commit that referenced this issue Mar 21, 2017
* Make the Runner manage the snapshot state. Thread an accessor to the
`t.snapshot()` assertion.

* Save snapshots when runner has finished. Fixes #1218.

* Use jest-snapshot directly, without serializing values. Use jest-diff
to generate the diff if the snapshot doesn't match. This does mean the
output is not colored and has other subtle differences with how other
assertions format values, but that's OK for now. Fixes #1220, #1254.

* Pin jest-snapshot and jest-diff versions. This isn't ideal but we're
using private APIs and making other assumptions, so I'm not comfortable
with using a loose SemVer range.
novemberborn added a commit that referenced this issue Mar 23, 2017
* Make the Runner manage the snapshot state. Thread an accessor to the
`t.snapshot()` assertion.

* Save snapshots when runner has finished. Fixes #1218.

* Use jest-snapshot directly, without serializing values. Use jest-diff
to generate the diff if the snapshot doesn't match. This does mean the
output is not colored and has other subtle differences with how other
assertions format values, but that's OK for now. Fixes #1220, #1254.

* Pin jest-snapshot and jest-diff versions. This isn't ideal but we're
using private APIs and making other assumptions, so I'm not comfortable
with using a loose SemVer range.
novemberborn added a commit that referenced this issue Mar 23, 2017
* Make the Runner manage the snapshot state. Thread an accessor to the
`t.snapshot()` assertion.

* Save snapshots when runner has finished. Fixes #1218.

* Use jest-snapshot directly, without serializing values. Use jest-diff
to generate the diff if the snapshot doesn't match. This does mean the
output is not colored and has other subtle differences with how other
assertions format values, but that's OK for now. Fixes #1220, #1254.

* Pin jest-snapshot and jest-diff versions. This isn't ideal but we're
using private APIs and making other assumptions, so I'm not comfortable
with using a loose SemVer range.
novemberborn added a commit that referenced this issue Mar 26, 2017
* Make the Runner manage the snapshot state. Thread an accessor to the
`t.snapshot()` assertion.

* Save snapshots when runner has finished. Fixes #1218.

* Use jest-snapshot directly, without serializing values. Use jest-diff
to generate the diff if the snapshot doesn't match. This does mean the
output is not colored and has other subtle differences with how other
assertions format values, but that's OK for now. Fixes #1220, #1254.

* Pin jest-snapshot and jest-diff versions. This isn't ideal but we're
using private APIs and making other assumptions, so I'm not comfortable
with using a loose SemVer range.
novemberborn added a commit that referenced this issue Apr 2, 2017
* Make the Runner manage the snapshot state. Thread an accessor to the
`t.snapshot()` assertion.

* Save snapshots when runner has finished. Fixes #1218.

* Use jest-snapshot directly, without serializing values. Use jest-diff
to generate the diff if the snapshot doesn't match. This does mean the
output is not colored and has other subtle differences with how other
assertions format values, but that's OK for now. Fixes #1220, #1254.

* Pin jest-snapshot and jest-diff versions. This isn't ideal but we're
using private APIs and making other assumptions, so I'm not comfortable
with using a loose SemVer range.
novemberborn added a commit that referenced this issue Apr 2, 2017
* Make the Runner manage the snapshot state. Thread an accessor to the
`t.snapshot()` assertion.

* Save snapshots when runner has finished. Fixes #1218.

* Use jest-snapshot directly, without serializing values. Use jest-diff
to generate the diff if the snapshot doesn't match. This does mean the
output is not colored and has other subtle differences with how other
assertions format values, but that's OK for now. Fixes #1220, #1254.

* Pin jest-snapshot and jest-diff versions. This isn't ideal but we're
using private APIs and making other assumptions, so I'm not comfortable
with using a loose SemVer range.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants