Update documentation for testing infrastructure

- Add test commands to CLAUDE.md and README.md
- Update file structure to include game-logic.js and __tests__/
- Document Jest test suite with 57 tests
This commit is contained in:
2026-03-21 09:03:58 +00:00
parent 80f59fd3b3
commit 6d8ee7dda8
2 changed files with 33 additions and 3 deletions
+23 -1
View File
@@ -38,6 +38,23 @@ The last player standing wins!
5. Click "READY" when all players are ready
## Testing
Run the test suite:
```bash
cd server && npm test
```
Run with coverage:
```bash
cd server && npm run test:coverage
```
The test suite includes 57 tests covering:
- Unit tests for pure game logic functions
- Integration tests for garbage system
- Socket.io integration tests for multiplayer flow
## Controls
- **Arrow Left/Right**: Move piece
@@ -58,7 +75,12 @@ The last player standing wins!
```
tetris-battle-royale/
├── server/
│ ├── index.js # Node.js + Socket.io server
│ ├── index.js # Node.js + Socket.io server
│ ├── game-logic.js # Pure game logic functions (testable)
│ ├── __tests__/ # Jest test suite
│ │ ├── game-logic.test.js
│ │ ├── garbage-system.test.js
│ │ └── socket-integration.test.js
│ └── package.json
├── public/
│ ├── index.html # Main HTML