Skip to content

Commit 3ec5e52

Browse files
committed
Add env test.
1 parent 5e47a43 commit 3ec5e52

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

express-zod-api/tests/env.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import createHttpError from "http-errors";
22
import * as R from "ramda";
33
import { z } from "zod";
4+
import { createRequire } from "node:module";
45

56
describe("Environment checks", () => {
7+
describe("Zod global registry", () => {
8+
test("is shared across both of its ESM and CJS packages", () => {
9+
createRequire(import.meta.url)("zod");
10+
const { globalRegistry } = createRequire(import.meta.url)("zod");
11+
expect(globalRegistry).toBe(z.globalRegistry);
12+
});
13+
});
14+
615
describe("Zod Dates", () => {
716
test.each(["2021-01-32", "22/01/2022", "2021-01-31T25:00:00.000Z"])(
817
"should detect invalid date %#",

0 commit comments

Comments
 (0)