From 23b1cc32f1ba6a6277f81abc2b7862d5fed3fc0e Mon Sep 17 00:00:00 2001 From: Noritaka Kobayashi Date: Thu, 9 Oct 2025 22:37:02 +0900 Subject: [PATCH] refactor(test): remove redundant undefined --- tests/types/create.test-d.ts | 16 ++++++++-------- tests/types/find-many.test-d.ts | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/types/create.test-d.ts b/tests/types/create.test-d.ts index 33e34e3..eb20451 100644 --- a/tests/types/create.test-d.ts +++ b/tests/types/create.test-d.ts @@ -10,7 +10,7 @@ it('infers initial values from primitives in the schema', async () => { new Collection({ schema: z.object({ id: z.number().optional() }) }).create, ) .parameter(0) - .toEqualTypeOf<{ id?: number | undefined }>() + .toEqualTypeOf<{ id?: number }>() expectTypeOf(new Collection({ schema: z.object({ id: z.string() }) }).create) .parameter(0) @@ -20,7 +20,7 @@ it('infers initial values from primitives in the schema', async () => { new Collection({ schema: z.object({ id: z.string().optional() }) }).create, ) .parameter(0) - .toEqualTypeOf<{ id?: string | undefined }>() + .toEqualTypeOf<{ id?: string }>() }) it('infers initial values from a nested schema', async () => { @@ -40,7 +40,7 @@ it('infers initial values from a nested schema', async () => { }).create, ) .parameter(0) - .toEqualTypeOf<{ address: { street?: string | undefined } }>() + .toEqualTypeOf<{ address: { street?: string } }>() expectTypeOf( new Collection({ @@ -50,7 +50,7 @@ it('infers initial values from a nested schema', async () => { }).create, ) .parameter(0) - .toEqualTypeOf<{ address?: { street: string } | undefined }>() + .toEqualTypeOf<{ address?: { street: string } }>() }) it('infers the record type (return type) from the schema', async () => { @@ -60,7 +60,7 @@ it('infers the record type (return type) from the schema', async () => { expectTypeOf( new Collection({ schema: z.object({ id: z.number().optional() }) }).create, - ).returns.resolves.toEqualTypeOf>() + ).returns.resolves.toEqualTypeOf>() expectTypeOf( new Collection({ schema: z.object({ id: z.string() }) }).create, @@ -68,7 +68,7 @@ it('infers the record type (return type) from the schema', async () => { expectTypeOf( new Collection({ schema: z.object({ id: z.string().optional() }) }).create, - ).returns.resolves.toEqualTypeOf>() + ).returns.resolves.toEqualTypeOf>() expectTypeOf( new Collection({ @@ -85,7 +85,7 @@ it('infers the record type (return type) from the schema', async () => { }), }).create, ).returns.resolves.toEqualTypeOf< - RecordType<{ address: { street?: string | undefined } }> + RecordType<{ address: { street?: string } }> >() expectTypeOf( @@ -95,6 +95,6 @@ it('infers the record type (return type) from the schema', async () => { }), }).create, ).returns.resolves.toEqualTypeOf< - RecordType<{ address?: { street: string } | undefined }> + RecordType<{ address?: { street: string } }> >() }) diff --git a/tests/types/find-many.test-d.ts b/tests/types/find-many.test-d.ts index a47082a..fe583fe 100644 --- a/tests/types/find-many.test-d.ts +++ b/tests/types/find-many.test-d.ts @@ -113,9 +113,9 @@ it('supports sorting the results', () => { .toHaveProperty('orderBy') .toEqualTypeOf< | { - id?: SortDirection | undefined - name?: SortDirection | undefined - nested?: { key?: SortDirection | undefined } + id?: SortDirection + name?: SortDirection + nested?: { key?: SortDirection } } | undefined >()