add git diffs and permission support
This commit is contained in:
+19
-1
@@ -1,12 +1,30 @@
|
||||
import { startServers } from './server-utils.js';
|
||||
import { E2E_BACKEND_PORT, E2E_FRONTEND_PORT } from './playwright.config.js';
|
||||
import { unlinkSync } from 'fs';
|
||||
import { homedir } from 'os';
|
||||
import { join } from 'path';
|
||||
|
||||
function cleanupTestFiles() {
|
||||
const testFile = join(homedir(), 'foo.md');
|
||||
try {
|
||||
unlinkSync(testFile);
|
||||
console.log('Cleaned up test file:', testFile);
|
||||
} catch {
|
||||
// File doesn't exist, ignore
|
||||
}
|
||||
}
|
||||
|
||||
export default async function globalSetup() {
|
||||
// Clean up test files from previous runs
|
||||
cleanupTestFiles();
|
||||
|
||||
// Skip if servers are managed externally (e.g., by scripts/test)
|
||||
if (process.env.SKIP_SERVER_SETUP) {
|
||||
console.log('\n=== Skipping server setup (SKIP_SERVER_SETUP is set) ===\n');
|
||||
return;
|
||||
}
|
||||
console.log('\n=== Starting E2E Test Environment ===\n');
|
||||
await startServers(3000, 5173);
|
||||
console.log(`Backend port: ${E2E_BACKEND_PORT}, Frontend port: ${E2E_FRONTEND_PORT}`);
|
||||
await startServers(E2E_BACKEND_PORT, E2E_FRONTEND_PORT);
|
||||
console.log('\n=== E2E Test Environment Ready ===\n');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user