Skip to content

Commit 9aae3a4

Browse files
author
Lasim
committed
chore(tests): add backend build, unit, e2e tests, and linting to release workflow
1 parent 0aecbb8 commit 9aae3a4

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

.github/workflows/backend-release-pr.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ jobs:
4646
echo "npm ci failed, trying clean install..."
4747
npm install --no-optional
4848
}
49+
50+
- name: Backend Build Test
51+
working-directory: services/backend
52+
run: npm run build
53+
54+
- name: Backend Unit Tests
55+
working-directory: services/backend
56+
run: npm run test:unit
57+
58+
- name: Backend E2E Tests
59+
working-directory: services/backend
60+
run: npm run test:e2e
61+
62+
- name: Backend Lint
63+
working-directory: services/backend
64+
run: npm run lint
65+
4966
- name: Prepare release
5067
working-directory: services/backend
5168
env:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dev:frontend": "cd services/frontend && npm run dev",
99
"dev:backend": "cd services/backend && npm run dev",
1010
"build:frontend": "cd services/frontend && npm run build",
11-
"build:backend": "cd services/backend && npm run lint",
11+
"build:backend": "cd services/backend && npm run build",
1212
"lint:md": "npx markdownlint-cli2 '**/*.md' '#node_modules' '#**/node_modules/**' '#.github' '#**/CHANGELOG.md' '#**/._*'",
1313
"lint:frontend": "cd services/frontend && npm run lint",
1414
"lint:backend": "cd services/backend && npm run lint",

services/backend/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
transform: {
1111
'^.+\\.ts$': ['ts-jest', {
1212
useESM: false,
13+
tsconfig: 'tsconfig.test.json',
1314
}],
1415
},
1516
// Run tests sequentially to ensure proper order

services/backend/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"@src/*": ["src/*"]
1313
}
1414
},
15-
"include": ["src/**/*.ts", "tests/**/*.ts"],
15+
"include": ["src/**/*.ts"],
1616
"exclude": ["node_modules"]
1717
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"types": ["vitest/globals", "jest", "@types/jest", "@types/supertest"]
5+
},
6+
"include": ["src/**/*.ts", "tests/**/*.ts"]
7+
}

services/backend/vitest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export default defineConfig({
77
exclude: ['tests/e2e/**/*'],
88
watch: false, // Disable watch mode by default
99
testTimeout: 10000, // 10 seconds timeout for unit tests
10+
typecheck: {
11+
tsconfig: 'tsconfig.test.json',
12+
},
1013
coverage: {
1114
provider: 'v8',
1215
reporter: ['text', 'json', 'html'],

0 commit comments

Comments
 (0)