test(e2e): fix preflight fixture scope and path handling

This commit is contained in:
kl
2026-03-04 12:54:42 +08:00
parent 7f6ad472c4
commit 3b0f7af382
3 changed files with 9 additions and 5 deletions

View File

@@ -1,8 +1,10 @@
import fs from 'node:fs';
import path from 'node:path';
import { execFileSync } from 'node:child_process';
import { fileURLToPath } from 'node:url';
const fixturesDir = path.resolve(process.cwd(), 'tests/e2e/fixtures');
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const fixturesDir = path.resolve(__dirname, '..', 'fixtures');
fs.mkdirSync(fixturesDir, { recursive: true });
const write = (name, content) => fs.writeFileSync(path.join(fixturesDir, name), content);