Replies: 1 comment
-
Insta doesn’t understand the snapshot format. It does a string compare so all normalization needs to happen ahead of time. I’m not sure what a good solution I can provide here. Maybe you could build yourself a script that sorts the JSON and then you paste that in. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
Is there any way to do snapshot matching where the order of object keys is not a concern? I know about
sort_keys
, but this just sorts the rendered JSON before comparing it to the snapshot which isn't quite the same thing.In particular, I'm building a HAL implementation, and part of that I'm comparing the rendered output to the example from the spec. Except that the example isn't strictly ordered. This is in ways that don't actually affect anything, but it does mean that I can't just paste the example as-is into the snapshot and have it work.
Probably what I want is something like
sort_keys
but working on the snapshot as well as the rendered JSON.Cheers
Beta Was this translation helpful? Give feedback.
All reactions