forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.setup.ts
More file actions
22 lines (18 loc) · 753 Bytes
/
Copy pathglobal.setup.ts
File metadata and controls
22 lines (18 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { test as setup } from '@playwright/test';
import { constants } from '../constants';
import { appConfigs } from '../presets';
import { fs, parseEnvOptions, startClerkJsHttpServer } from '../scripts';
setup('start long running apps', async () => {
await fs.ensureDir(constants.TMP_DIR);
await startClerkJsHttpServer();
const { appIds } = parseEnvOptions();
if (appIds.length) {
const apps = appConfigs.longRunningApps.getByPattern(appIds);
// state cannot be shared using playwright,
// so we save the state in a file using a strategy similar to `storageState`
await Promise.all(apps.map(app => app.init()));
} else {
// start a single app using the available env variables
}
console.log('Apps started');
});