Skip to content

Releases: timdeschryver/zod-fixture

v2.1.4

22 Jul 13:34
12d855d

Choose a tag to compare

2.1.4 (2023-07-22)

Bug Fixes

v2.1.3

21 Jul 13:40
f8c8d4e

Choose a tag to compare

2.1.3 (2023-07-21)

Bug Fixes

v2.1.2

20 Jul 08:01
b75079a

Choose a tag to compare

2.1.2 (2023-07-20)

Bug Fixes

v2.1.1

19 Jul 13:28
183a6eb

Choose a tag to compare

2.1.1 (2023-07-19)

Bug Fixes

  • defaults conflict with user checks (#73) (183a6eb)

v2.1.0

17 Jul 16:07
130d875

Choose a tag to compare

2.1.0 (2023-07-17)

Features

  • include missing generators in defaults (#67) (130d875)

v2.0.0

17 Jul 14:56
40dae26

Choose a tag to compare

2.0.0 (2023-07-17)

Features

BREAKING CHANGES

This version is a total rewrite of v1.
For more info, check out the documentation at https://zod-fixture.timdeschryver.dev/ .

Thanks for all the help @THEtheChad 🤝

Why a rewrite?

v1 was flexible and allowed that multiple validation libraries could be supported in the future.
But, this made things more complex and I don't think we intended to add more libraries than zod.

v2 is a full-on zod version.
This benefits you because we make more use of zod's schema while creating fixtures.
For example, when you want to create a custom generator (previously a customization) you can also access zod's schema definition.

Fixture Generation with 1:1 Zod Parity

Breaking changes

createFixture

createFixture still exists, but it could be that it generated its output with a slightly different output.
It still is compatible (even more compatible) with zod's schema.
For example, the changes to a string output:

BEFORE:

street-a088e991-896e-458c-bbbd-7045cd880879

AFTER:

fbmiabahyvsy-vm

Customization

Customization is renamed to Generator.

BEFORE:

const addressCustomization: Customization = {
	condition: ({ type, propertName }) =>
		type === 'object' && propertName === 'address',
	generator: () => {
		return {
			street: 'My Street',
			city: 'My City',
			state: 'My State',
		};
	},
};

AFTER:

const addressGenerator = Generator({
	schema: ZodObject,
	filter: ({ context }) => context.path.at(-1) === 'address',
	output: () => ({
		street: 'My Street',
		city: 'My City',
		state: 'My State',
	}),
});

For more info, check out the documentation at https://zod-fixture.timdeschryver.dev/ .

v2.0.0-beta.16

17 Jul 09:18
15e67e8

Choose a tag to compare

v2.0.0-beta.16 Pre-release
Pre-release

2.0.0-beta.16 (2023-07-17)

Features

  • add datetime customization (#16) (d025acf), closes #15
  • support string().url() (#51) (2b41d57)
  • support TS 5 type exports for moduleResolution: "bundler" (#29) (0b8df1c)

v2.0.0-beta.15

17 Jul 05:59
86ea6b2

Choose a tag to compare

v2.0.0-beta.15 Pre-release
Pre-release

2.0.0-beta.15 (2023-07-17)

Features

v2.0.0-beta.14

15 Jul 18:51
8b34b04

Choose a tag to compare

v2.0.0-beta.14 Pre-release
Pre-release

2.0.0-beta.14 (2023-07-15)

Features

v2.0.0-beta.13

14 Jul 07:22
2fd78a0

Choose a tag to compare

v2.0.0-beta.13 Pre-release
Pre-release

2.0.0-beta.13 (2023-07-14)

Features

  • Isolated Seeding and Constrained Defaults for Deterministic and Constrained-Non-Deterministic Fixtures (#53) (2fd78a0)