Skip to content

Commit c2f1b64

Browse files
committed
Remove explicit type annotation, use toHaveProperty assertion
1 parent 3e2751f commit c2f1b64

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

express-zod-api/tests/json-schema-helpers.spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,9 @@ describe("JSON Schema helpers", () => {
220220
test.each([true, false])(
221221
"should initialize examples when flat has none (isOptional=%s)",
222222
(isOptional) => {
223-
const flat: { type: "object"; properties: {}; examples?: unknown[] } = {
224-
type: "object",
225-
properties: {},
226-
};
223+
const flat = { type: "object" as const, properties: {} };
227224
mergeExamples(flat, { examples: [{ a: 1 }] }, isOptional);
228-
expect(flat.examples).toEqual([{ a: 1 }]);
225+
expect(flat).toHaveProperty("examples", [{ a: 1 }]);
229226
},
230227
);
231228

0 commit comments

Comments
 (0)