Skip to content

Commit e5e452c

Browse files
Copilotymc9
andauthored
Fix: disconnect correct client instance in zod test finally block (#2415)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
1 parent 4fe27ef commit e5e452c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/e2e/orm/client-api/zod.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,14 +1003,14 @@ describe('Zod schema factory test', () => {
10031003

10041004
describe('create factory functions tests', () => {
10051005
it('can be constructed directly from client', async () => {
1006+
const localClient = await createTestClient(schema);
10061007
try {
1007-
const client = await createTestClient(schema);
1008-
const factory = createQuerySchemaFactory(client);
1008+
const factory = createQuerySchemaFactory(localClient);
10091009
const s = factory.makeFindManySchema('User');
10101010
expect(s.safeParse({ where: { email: 'u@test.com' } }).success).toBe(true);
10111011
expect(s.safeParse({ where: { notAField: 'val' } }).success).toBe(false);
10121012
} finally {
1013-
await client.$disconnect();
1013+
await localClient.$disconnect();
10141014
}
10151015
});
10161016

0 commit comments

Comments
 (0)