Closed dustin closed 2 years ago
We can do this, but you're not going to like the result. Arbitrary data is not what you want to be using in this case, you want fake data instead.
Understood. I've used hspec-golden-aeson
and the output is not super pleasant. It's not a replacement for having known hand-written bits, but it's better than trying to imagine all possibilities and having embedded objects change unexpectedly.
You might want to make a similar issue in the fake-data repo instead.
sydtest-aeson
does what you want, I think.
I'd like something similar to hspec-golden-aeson allowing
GenValidity
to create a sufficient consistent set of values that can be serialized and tested against in a golden test.Right now, one must think of all of the ways to build an object (including transitive values) and write tests for all the combinations. It'd be great to do this automatically.