unit tests fixin
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m7s

This commit is contained in:
2025-11-22 01:38:53 -08:00
parent ddbedcc9f9
commit 53c5f0bcbc
2 changed files with 15 additions and 4 deletions

View File

@@ -9,8 +9,9 @@
"preview": "vite preview",
"test": "vitest run --coverage",
"test:integration": "vitest run -c vitest.config.integration.ts",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"seed": "ts-node-dev scripts/seed.ts"
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"seed": "ts-node-dev scripts/seed.ts",
"start:server": "ts-node server.ts"
},
"dependencies": {
"@google/genai": "^1.30.0",

View File

@@ -14,8 +14,18 @@ export async function setup() {
// Start the backend server as a background process.
console.log('Starting backend server for integration tests...');
// We use ts-node-dev to run the TypeScript server directly.
const serverProcess = exec('npx ts-node-dev --transpile-only --quiet --notify=false server.ts');
// Use the dedicated npm script to start the server. This is cleaner and more reliable for CI.
// We also capture stdout and stderr to help debug server startup issues.
const serverProcess = exec('npm run start:server');
serverProcess.stdout?.on('data', (data) => {
console.log(`[SERVER STDOUT]: ${data}`);
});
serverProcess.stderr?.on('data', (data) => {
// Log server errors to the console for visibility in CI.
console.error(`[SERVER STDERR]: ${data}`);
});
// Wait for the server to be ready by polling the health check endpoint.
const maxRetries = 10;