Skip to content

Commit cef2c7d

Browse files
committed
chore(integration): Add apiUrl option to integration cleanup script
1 parent c9d2bac commit cef2c7d

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

integration/cleanup/cleanup.setup.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@ import { test as setup } from '@playwright/test';
55
import { appConfigs } from '../presets/';
66

77
setup('cleanup instances ', async () => {
8-
const secretKeys = Object.values(appConfigs.envs)
8+
const entries = Object.values(appConfigs.envs)
99
.map(e => e.toJson())
10-
.map(json => json.private)
11-
.map(keys => keys['CLERK_SECRET_KEY'])
10+
.map(json => {
11+
const secretKey = json.private['CLERK_SECRET_KEY'];
12+
if (!secretKey) {
13+
return null;
14+
}
15+
return { secretKey, apiUrl: json.private['CLERK_API_URL'] };
16+
})
1217
.filter(Boolean);
1318

14-
for (const secretKey of secretKeys) {
15-
console.log(`Cleanup for ${secretKey.replace(/(sk_test_)(.+)(...)/, '$1***$3')}`);
16-
const clerkClient = createClerkClient({ secretKey });
19+
for (const entry of entries) {
20+
console.log(`Cleanup for ${entry!.secretKey.replace(/(sk_test_)(.+)(...)/, '$1***$3')}`);
21+
const clerkClient = createClerkClient({ secretKey: entry!.secretKey, apiUrl: entry?.apiUrl });
1722
const { data: users, errors } = await clerkClient.users.getUserList({
1823
orderBy: '-created_at',
1924
query: 'clerkcookie',

0 commit comments

Comments
 (0)