()
| 22 | } |
| 23 | |
| 24 | export function loadTestEnv(): TestEnv & { api: BytebaseApiClient } { |
| 25 | if (!fs.existsSync(ENV_FILE)) { |
| 26 | throw new Error( |
| 27 | ".e2e-env.json not found. Run the setup project first (npx playwright test)." |
| 28 | ); |
| 29 | } |
| 30 | const raw = JSON.parse(fs.readFileSync(ENV_FILE, "utf-8")) as TestEnv; |
| 31 | const api = new BytebaseApiClient({ |
| 32 | baseURL: raw.baseURL, |
| 33 | credentials: { email: raw.adminEmail, password: raw.adminPassword }, |
| 34 | }); |
| 35 | return { ...raw, api }; |
| 36 | } |
| 37 | |
| 38 | export function cleanupEnvFile(): void { |
| 39 | if (fs.existsSync(ENV_FILE)) fs.unlinkSync(ENV_FILE); |
no outgoing calls
no test coverage detected