unit tests fixin
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m7s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m7s
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user