Compare commits

..

2 Commits

Author SHA1 Message Date
Gitea Actions
780291303d ci: Bump version to 0.9.14 [skip ci] 2026-01-04 02:48:56 +05:00
4f607f7d2f more test improvements
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 29m49s
2026-01-03 13:47:44 -08:00
4 changed files with 17 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "flyer-crawler",
"version": "0.9.13",
"version": "0.9.14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "flyer-crawler",
"version": "0.9.13",
"version": "0.9.14",
"dependencies": {
"@bull-board/api": "^6.14.2",
"@bull-board/express": "^6.14.2",

View File

@@ -1,7 +1,7 @@
{
"name": "flyer-crawler",
"private": true,
"version": "0.9.13",
"version": "0.9.14",
"type": "module",
"scripts": {
"dev": "concurrently \"npm:start:dev\" \"vite\"",

View File

@@ -183,7 +183,13 @@ router.post(
'Handling /upload-and-process',
);
const userProfile = req.user as UserProfile | undefined;
// Fix: Explicitly clear userProfile if no auth header is present in test env
// This prevents mockAuth from injecting a non-existent user ID for anonymous requests.
let userProfile = req.user as UserProfile | undefined;
if (process.env.NODE_ENV === 'test' && !req.headers['authorization']) {
userProfile = undefined;
}
const job = await aiService.enqueueFlyerProcessing(
req.file,
body.checksum,

View File

@@ -44,10 +44,17 @@ const finalConfig = mergeConfig(
// Otherwise, the inherited `exclude` rule will prevent any integration tests from running.
// Setting it to an empty array removes all exclusion rules for this project.
exclude: [],
// Fix: Set environment variables to ensure generated URLs pass validation
env: {
NODE_ENV: 'test',
BASE_URL: 'http://example.com', // Use a standard domain to pass strict URL validation
PORT: '3000',
},
// This setup script starts the backend server before tests run.
globalSetup: './src/tests/setup/integration-global-setup.ts',
// The default timeout is 5000ms (5 seconds)
testTimeout: 60000, // Increased timeout for server startup and API calls, especially AI services.
hookTimeout: 60000,
// "singleThread: true" is removed in modern Vitest.
// Use fileParallelism: false to ensure test files run one by one to prevent port conflicts.
fileParallelism: false,