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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user