feat: assert_compact_pretty_json_snapshot
implement #805
I very much agree with the value of compact snapshots
but I'm a bit worried about macro proliferation; that we have a different macro for each combination of settings. I was already a bit hesitant about assert_compact_json_snapshot, but IIRC @mitsuhiko was keener.
alternatives would include:
- start with a wrapper in the crate being tested that ran the compact json and then passed to
assert_snapshot - adding code to
instaso we can set settings for how to serialize
@mitsuhiko do you have thoughts?
can we simply re-target assert_compact_json_snapshot to use this new renderer?
P.S. the fewer settings we have in insta, the better - conventions over configuration :)
can we simply re-target
assert_compact_json_snapshotto use this new renderer?
but I think it would be backward incompat because it would require enabling a feature? (and we would want a new feature as it would be adding a dependency...)
unless someone wants to re-implement it in-place... Than again, I have no idea why insta wants to maintain a JSON rendering code rather than just use serde_json? Doesn't seem like a high value thing, esp considering that serde_json is looked at by so many more people...
P.S. technically adding a small mandatory dependency is not a biggie of course
Than again, I have no idea why
instawants to maintain a JSON rendering code rather than just use serde_json?
yeah, there's some modest history there; discussions are easy to grab