test(api): add unit and integration tests for game service and endpoints

- Unit tests for createGameSession and evaluateAnswer (14 tests)
- Endpoint tests for POST /game/start and /game/answer via supertest (8 tests)
- Mock @glossa/db — no real database dependency
This commit is contained in:
lila 2026-04-12 09:04:41 +02:00
parent 48457936e8
commit e320f43d8e
5 changed files with 559 additions and 21 deletions

View file

@ -6,7 +6,8 @@
"scripts": {
"dev": "tsx watch src/server.ts",
"build": "tsc",
"start": "node dist/server.js"
"start": "node dist/server.js",
"test": "vitest"
},
"dependencies": {
"@glossa/db": "workspace:*",
@ -15,6 +16,8 @@
},
"devDependencies": {
"@types/express": "^5.0.6",
"@types/supertest": "^7.2.0",
"supertest": "^7.2.2",
"tsx": "^4.21.0"
}
}