Multiplayer GameService unit tests #51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Multiplayer game logic needs thorough testing across all game modes.
Files to create
apps/api/src/services/multiplayerGameService.test.tsTest cases
General: question generation, score calculation, cumulative scores.
Elimination: wrong = eliminated, last standing wins, all wrong same round, single remaining.
Race to the Top: first to target wins, same-round tie, correct tracking.
Chain Link: turn order maintained, wrong on your turn ends game.
TV Quiz Show: first buzz priority, correct/wrong buzz scoring, no buzz timeout.
Timer: timeout triggers evaluation, answers after timeout rejected.
Acceptance criteria
gameService.test.tspattern)vi.useFakeTimers())Notes
Reference:
apps/api/src/services/gameService.test.ts. Usevi.mockfor DB mocking.