Add end-to-end test verifying the complete ratings and stats update flow: - Auto match creation from suggestion acceptance - Both users rating each other - Stats updated exactly once (recordingsDone/recordingsReceived) - Manual matches do NOT update stats - Double-rating prevention (idempotency) Test coverage (9 scenarios): - STEP 1-3: Event creation, user enrollment, heat declaration - STEP 4: Matching algorithm execution + saveMatchingResults fix - STEP 5: Suggestion acceptance creates auto match (source='auto') - STEP 6a: First rating (no stats update yet) - STEP 6b: Second rating triggers stats update + match completion - STEP 7: Verify duplicate rating prevention - STEP 8: Verify manual matches don't affect fairness stats Infrastructure: - Add jest.setup.js to load .env.development for all tests - Update package.json to use setupFilesAfterEnv Documentation: - Mark S10 (Ratings & Stats) as ✅ IMPLEMENTED in TODO.md - Remove from Critical Gaps section - Add detailed implementation references All tests passing ✅
73 lines
1.7 KiB
JSON
73 lines
1.7 KiB
JSON
{
|
|
"name": "spotlightcam-backend",
|
|
"version": "1.0.0",
|
|
"description": "Backend API for spotlight.cam - P2P video exchange for dance events",
|
|
"main": "src/server.js",
|
|
"scripts": {
|
|
"start": "node src/server.js",
|
|
"dev": "nodemon src/server.js",
|
|
"test": "jest --coverage",
|
|
"test:watch": "jest --watch",
|
|
"prisma:generate": "prisma generate",
|
|
"prisma:migrate": "prisma migrate dev",
|
|
"prisma:seed": "node prisma/seed.js",
|
|
"prisma:studio": "prisma studio",
|
|
"cli": "node src/cli/index.js"
|
|
},
|
|
"keywords": [
|
|
"webrtc",
|
|
"p2p",
|
|
"video",
|
|
"dance",
|
|
"matchmaking"
|
|
],
|
|
"author": "",
|
|
"license": "ISC",
|
|
"dependencies": {
|
|
"@aws-sdk/client-ses": "^3.930.0",
|
|
"@prisma/client": "^5.8.0",
|
|
"bcryptjs": "^2.4.3",
|
|
"cookie-parser": "^1.4.7",
|
|
"cors": "^2.8.5",
|
|
"csurf": "^1.11.0",
|
|
"dompurify": "^3.3.0",
|
|
"dotenv": "^16.3.1",
|
|
"express": "^4.18.2",
|
|
"express-rate-limit": "^8.2.1",
|
|
"express-validator": "^7.3.0",
|
|
"helmet": "^8.1.0",
|
|
"jsdom": "^27.2.0",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"socket.io": "^4.8.1"
|
|
},
|
|
"devDependencies": {
|
|
"jest": "^29.7.0",
|
|
"nodemon": "^3.0.2",
|
|
"prisma": "^5.8.0",
|
|
"socket.io-client": "^4.8.1",
|
|
"supertest": "^6.3.3"
|
|
},
|
|
"jest": {
|
|
"testEnvironment": "node",
|
|
"setupFilesAfterEnv": ["<rootDir>/jest.setup.js"],
|
|
"coveragePathIgnorePatterns": [
|
|
"/node_modules/"
|
|
],
|
|
"testMatch": [
|
|
"**/__tests__/**/*.test.js"
|
|
],
|
|
"moduleNameMapper": {
|
|
"^jsdom$": "<rootDir>/src/__mocks__/jsdom.js",
|
|
"^dompurify$": "<rootDir>/src/__mocks__/dompurify.js"
|
|
}
|
|
},
|
|
"prisma": {
|
|
"seed": "node prisma/seed.js"
|
|
},
|
|
"overrides": {
|
|
"csurf": {
|
|
"cookie": "^0.7.0"
|
|
}
|
|
}
|
|
}
|