test: fill coverage gaps in lobbyService and gameService
- joinLobby: addPlayer returns falsy (race condition fallback) - joinLobby: lobby disappears between addPlayer and final fetch - createLobby: non-unique-violation errors re-thrown immediately - createGameSession: unexpected DB errors propagate correctly
This commit is contained in:
parent
76192667e0
commit
4ece995385
2 changed files with 34 additions and 0 deletions
|
|
@ -126,6 +126,14 @@ describe("createGameSession", () => {
|
|||
|
||||
expect(mockGetDistractors).toHaveBeenCalledTimes(3);
|
||||
});
|
||||
|
||||
it("propagates unexpected errors from getGameTerms", async () => {
|
||||
mockGetGameTerms.mockRejectedValue(new Error("connection refused"));
|
||||
|
||||
await expect(createGameSession(validRequest)).rejects.toThrow(
|
||||
"connection refused",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("evaluateAnswer", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue