Follow up: unify v3 and v4 zod types via describe matrix and a test helper (#1141)
This commit is contained in:
parent
9438478aaf
commit
43189335a3
1 changed files with 6993 additions and 17620 deletions
22
src/shared/zodTestMatrix.ts
Normal file
22
src/shared/zodTestMatrix.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import * as z3 from 'zod/v3';
|
||||
import * as z4 from 'zod/v4';
|
||||
|
||||
// Shared Zod namespace type that exposes the common surface area used in tests.
|
||||
export type ZNamespace = typeof z3 & typeof z4;
|
||||
|
||||
export const zodTestMatrix = [
|
||||
{
|
||||
zodVersionLabel: 'Zod v3',
|
||||
z: z3 as ZNamespace,
|
||||
isV3: true as const,
|
||||
isV4: false as const
|
||||
},
|
||||
{
|
||||
zodVersionLabel: 'Zod v4',
|
||||
z: z4 as ZNamespace,
|
||||
isV3: false as const,
|
||||
isV4: true as const
|
||||
}
|
||||
] as const;
|
||||
|
||||
export type ZodMatrixEntry = (typeof zodTestMatrix)[number];
|
||||
Loading…
Reference in a new issue