test: add comprehensive test suite for server

- Add load testing with Artillery (smoke, standard, peak, stress)
- Add functional tests: voting, lottery, admin (18 tests)
- Add fault tolerance tests (14 tests)
- Add network tests for WebSocket (7 tests)
- Add compatibility tests (15 tests)
- Add security tests: anti-fraud, auth, data integrity (10 tests)
- Fix optional callback handling in socket handlers
- Total: 64 test cases, all passing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-01-25 19:53:16 +08:00
parent 22141c9263
commit 75570af8bc
15 changed files with 6716 additions and 37 deletions

View File

@@ -0,0 +1,15 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['src/**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
include: ['src/services/**/*.ts'],
},
testTimeout: 10000,
},
});