Closed timdeschryver closed 1 year ago
@THEtheChad I had to change the implementation of multipleOf
because it was flaky, and it was also returning values that weren't compatible with zod.
That's why I also created the following test, maybe we should do this for most of them to be sure we're following zod's rules. Or, atleast great some integration tests to verify that fixtures are OK.
test("creates a number that's a multiple", () => {
const schema = z.number().multipleOf(4);
const result = core.generate(schema);
expect(() => schema.parse(result)).not.toThrow();
});
I think this is a great idea, @timdeschryver. There's one issue I can foresee. I created a separate PR (https://github.com/timdeschryver/zod-fixture/pull/25) to address this with the example you provided. I have a detailed explanation in the description.
:tada: This PR is included in version 2.0.0-beta.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket: