Closed THEtheChad closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
zod-fixture | ✅ Ready (Inspect) | Visit Preview | Aug 6, 2023 1:10pm |
I like the idea of alternating booleans for "Constrained Non-Determinism" but implementing it correctly feels tricky. In many cases, you need to know more about the problem domain to know whether alternating the booleans makes sense. I think that's an exercise best left to the end user.
To your point, I think we could package generators outside of the defaults that provide this level of functionality and the users can choose to plug them in where it makes sense.
:tada: This PR is included in version 2.4.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Some schemas can be satisfied by more than one input (ie: optional, nullable, nullish). In many of these cases, we were only generating one of the potential variants. In a testing context, this meant that you could not produce certain variants of a fixture and in a mocking context (ie: apis) it meant that many of the potential code paths would never be explored.
This update produces psuedo random fixtures in a deterministic way via the seed.
Using this philosophy, I removed the alternating booleans. While useful in instances where a list is produced:
It made no sense when using nested values:
If we really wanted to re-enable this, I could add an option to the config: