Skip to content

Commit 5f0db8a

Browse files
committed
test: fix test errors
1 parent ae1b67c commit 5f0db8a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/core/mask.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ describe("maskWithReference", () => {
2323
id: { type: "string" },
2424
name: { type: "string" },
2525
},
26+
required: ["id", "name"],
27+
additionalProperties: false,
2628
};
2729

2830
const result = maskWithReference(schema, storedSchemas, true);
@@ -76,6 +78,8 @@ describe("maskWithReference", () => {
7678
id: { type: "string" },
7779
name: { type: "string" },
7880
},
81+
required: ["id", "name"],
82+
additionalProperties: false,
7983
};
8084
const result = maskWithReference(schema, storedSchemas, true);
8185
expect(result).toEqual({

src/core/transpile.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { transpile } from "./transpile";
33

44
describe("transpile", () => {
55
it("should inject export fixers", () => {
6-
const result = transpile("", "defineRoute");
6+
const result = transpile("", "defineRoute", null);
77
expect(result).toContain("exports.GET = void 0;");
88
expect(result).toContain("exports.POST = void 0;");
99
expect(result).toContain("exports.PUT = void 0;");
@@ -19,12 +19,12 @@ describe("transpile", () => {
1919
const filePath = "src/app/users/route.ts";
2020
const response = await fetch(`https://raw.githubusercontent.com/${repoName}/refs/heads/${branchName}/${filePath}`);
2121
const example = await response.text();
22-
const result = transpile(example, "defineRoute");
22+
const result = transpile(example, "defineRoute", null);
2323
expect(result).toContain("require(\"@omer-x/next-openapi-route-handler\");");
2424
});
2525

2626
it("should not inject '@omer-x/next-openapi-route-handler' while it is not necessary", () => {
27-
const result = transpile("", "defineRoute");
27+
const result = transpile("", "defineRoute", null);
2828
expect(result).not.toContain("require(\"@omer-x/next-openapi-route-handler\");");
2929
});
3030

@@ -36,12 +36,12 @@ describe("transpile", () => {
3636
name: z.string().min(3).max(255).optional(),
3737
});
3838
`;
39-
const result = transpile(rawCodeExample, "defineRoute");
39+
const result = transpile(rawCodeExample, "defineRoute", null);
4040
expect(result).toContain("require(\"zod\");");
4141
});
4242

4343
it("should not inject 'zod' while it is not necessary", () => {
44-
const result = transpile("", "defineRoute");
44+
const result = transpile("", "defineRoute", null);
4545
expect(result).not.toContain("require(\"zod\");");
4646
});
4747
});

0 commit comments

Comments
 (0)