This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
const RealSet = Set;
const RealMap = Map;
const RealDate = Date;
test("doesnt throw when Date is undefined", () => {
delete (globalThis as any).Date;
const result = z.object({}).safeParse({});
expect(result.success).toEqual(true);
globalThis.Date = RealDate;
});
test("doesnt throw when Set is undefined", () => {
delete (globalThis as any).Set;
const result = z.object({}).safeParse({});
expect(result.success).toEqual(true);
globalThis.Set = RealSet;
});
test("doesnt throw when Map is undefined", () => {
delete (globalThis as any).Map;
const result = z.object({}).safeParse({});
expect(result.success).toEqual(true);
globalThis.Map = RealMap;
});