Skip to content

Commit 7170adb

Browse files
committed
fix(e2e): guard handshake test teardown when app init fails
Use optional chaining on app?.teardown() and thisApp?.teardown() to prevent cascading TypeError when beforeAll fails before assigning app.
1 parent c877949 commit 7170adb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

integration/tests/handshake.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ test.describe('Client handshake with organization activation @nextjs', () => {
10761076
});
10771077

10781078
test.afterAll('setup local Clerk API mock', async () => {
1079-
await app.teardown();
1079+
await app?.teardown();
10801080
return new Promise<void>(resolve => jwksServer.close(() => resolve()));
10811081
});
10821082

@@ -1460,7 +1460,7 @@ test.describe('Client handshake with an organization activation avoids infinite
14601460
});
14611461

14621462
test.afterAll('setup local Clerk API mock', async () => {
1463-
await thisApp.teardown();
1463+
await thisApp?.teardown();
14641464
return new Promise<void>(resolve => jwksServer.close(() => resolve()));
14651465
});
14661466

0 commit comments

Comments
 (0)