Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .idea/jsLibraryMappings.xml

This file was deleted.

7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"vitest.enable": true,
"vitest.commandLine": "npm run test",
"testing.openTesting": "openOnTestStart",
"testing.followRunningTest": true,
"testing.defaultGutterClickAction": "run"
}
35 changes: 35 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Backend Tests",
"type": "shell",
"command": "npm test",
"options": {
"cwd": "${workspaceFolder}/backend"
},
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": {
"owner": "vitest",
"fileLocation": "absolute",
"pattern": {
"regexp": "^\s+at\s+(.*):(\d+):(\d+)$",
"file": 1,
"line": 2,
"column": 3
}
}
}
]
}
9 changes: 9 additions & 0 deletions backend/.cursor/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"vitest.vitest"
],
"unwantedRecommendations": [
"orta.vscode-jest",
"ms-vscode.vscode-jest"
]
}
16 changes: 16 additions & 0 deletions backend/.cursor/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"vitest.enable": true,
"vitest.commandLine": "npm test",
"vitest.rootConfig": "./vitest.config.mjs",
"typescript.preferences.includePackageJsonAutoImports": "auto",
"vitest.include": ["test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
"vitest.exclude": ["node_modules", "dist", ".idea", ".git", ".cache"],
"testing.automaticallyOpenPeekView": "never",
"testing.defaultGutterClickAction": "run",
"testing.followRunningTest": true,
"testing.openTesting": "neverOpen",
"testing.gutterEnabled": true,
"testing.showAllMessages": true,
}


6 changes: 3 additions & 3 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ version: '3.8'
services:
postgres:
image: postgres:16
container_name: app-postgres
container_name: auto_order-app-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: auto_order
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- auto_order_postgres_data:/var/lib/postgresql/data

volumes:
postgres_data:
auto_order_postgres_data:

1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"dotenv": "^17.2.1",
"drizzle-kit": "^0.31.4",
"esbuild": "^0.25.8",
"vite": "^7.1.4",
"vitest": "^3.2.4"
},
"overrides": {
Expand Down
17 changes: 17 additions & 0 deletions backend/test/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Test setup file for Vitest
import { beforeAll } from 'vitest'

// Set up test environment variables
beforeAll(() => {
// Set required environment variables for tests
process.env.JWT_SECRET = 'test-jwt-secret-key-for-testing-only'
process.env.NODE_ENV = 'test'

// Database configuration for tests
process.env.DB_HOST = 'localhost'
process.env.DB_PORT = '5432'
process.env.DB_USER = 'postgres'
process.env.DB_PASSWORD = 'postgres'
process.env.DB_NAME = 'auto_order_test'
})

2 changes: 1 addition & 1 deletion backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"skipLibCheck": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"]
"exclude": ["node_modules", "dist", "test"]
}
22 changes: 22 additions & 0 deletions backend/vitest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Vitest configuration for IDE test detection
export default {
test: {
globals: true,
environment: 'node',
include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: ['node_modules', 'dist', '.idea', '.git', '.cache'],
testTimeout: 10000,
hookTimeout: 10000,
setupFiles: ['./test/setup.ts'],
// Enable test discovery for IDEs
passWithNoTests: true,
},
resolve: {
alias: {
'@': './src',
},
},
}



Loading