pcbjam/tests/global-setup.ts
Viktor Vaczi 8453f9681e Add stamp source hashing and maximize test infrastructure
- Add source hashing to stamp system (functions.sh) for detecting
  when dependencies need rebuild based on source file changes
- Update build-pcbnew.sh to use source stamps for wxWidgets
- Add global-setup.ts to clean logs before test runs
- Add maximize_test standalone test to verify wxFrame::Maximize()
  works correctly in WASM (it does - window is 1280x720)
- Update Makefile.wasm with maximize test build rules

The maximize_test proves wxWidgets display detection works fine.
KiCad's 20x20 window bug is KiCad-specific, not a wxWidgets issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 13:28:43 +01:00

22 lines
642 B
TypeScript

import * as fs from 'fs';
import * as path from 'path';
/**
* Global setup for Playwright tests.
* Cleans the logs directory before each test run to prevent stale logs.
*/
export default async function globalSetup() {
const logsDir = path.join(__dirname, 'logs');
if (fs.existsSync(logsDir)) {
// Remove all files in logs directory
for (const file of fs.readdirSync(logsDir)) {
const filePath = path.join(logsDir, file);
// Only remove files, not subdirectories
if (fs.statSync(filePath).isFile()) {
fs.unlinkSync(filePath);
}
}
console.log(`[global-setup] Cleaned ${logsDir}`);
}
}