Skip to content

Commit e5f4958

Browse files
committed
test(spec): type the lazy-schema metadata pins through unknown
Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7ee3312 commit e5f4958

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/spec/src/shared/lazy-schema.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe('lazySchema × z.toJSONSchema metadata (#19101)', () => {
141141
it("the real instance's own describe wins over the one it inherits from its parent", () => {
142142
const Base = z.string().describe('inherited');
143143
const lazy = lazySchema(() => Base.describe('own'));
144-
const json = z.toJSONSchema(z.object({ v: lazy })) as { properties: { v: { description?: string } } };
144+
const json = z.toJSONSchema(z.object({ v: lazy })) as unknown as { properties: { v: { description?: string } } };
145145
expect(json.properties.v.description).toBe('own');
146146
});
147147

@@ -150,7 +150,7 @@ describe('lazySchema × z.toJSONSchema metadata (#19101)', () => {
150150
z.object({ x: z.string() }).meta({ id: 'LazySchemaIdProbe19101', description: 'probe' }),
151151
);
152152
const Doc = z.object({ a: (Leaf as any).optional(), b: z.lazy(() => Leaf) });
153-
const json = z.toJSONSchema(Doc) as { properties: { b: { description?: string } } };
153+
const json = z.toJSONSchema(Doc) as unknown as { properties: { b: { description?: string } } };
154154
expect(json.properties.b.description).toBe('probe');
155155
expect(z.globalRegistry.get(Leaf)?.id).toBeUndefined();
156156
});

0 commit comments

Comments
 (0)