Files
maestro/ui/e2e-global-teardown.ts
oss-sync 57702b4f34
CI / build-and-test (push) Canceled after 0s
sync: update from private repo (2336949a)
2026-09-17 11:29:31 +00:00

12 lines
801 B
TypeScript

import { cleanupOwnedRunDir } from '../scripts/e2e-run-dir.mjs';
export default function globalTeardown() {
// playwright の設定側が必ずセットする。未設定なら、この実行が作った
// 一時ディレクトリも無い。undefined のまま渡すと realpathSync が投げる。
const cacheRoot = process.env.E2E_CACHE_ROOT;
if (!cacheRoot) return;
cleanupOwnedRunDir({ cacheRoot, directory: process.env.E2E_RUN_TMP, prefix: process.env.E2E_RUN_PREFIX, token: process.env.E2E_RUN_TOKEN });
cleanupOwnedRunDir({ cacheRoot, directory: process.env.E2E_TMP, prefix: 'maestro-e2e-data-', token: process.env.E2E_DATA_TOKEN });
cleanupOwnedRunDir({ cacheRoot, directory: process.env.E2E_AUTH_TMP, prefix: 'maestro-e2e-auth-data-', token: process.env.E2E_DATA_TOKEN });
}