|
|
|
@ -191,6 +191,19 @@ describe("chase game model", () => { |
|
|
|
expect(state.turn).toBe(0); |
|
|
|
}); |
|
|
|
|
|
|
|
it("newRound applies the exact input seed and difficulty to snapshot", () => { |
|
|
|
mockedGenerateChaseRound |
|
|
|
.mockReturnValueOnce(makeRound(70, "normal")) |
|
|
|
.mockReturnValueOnce(makeRound(2027, "easy")); |
|
|
|
|
|
|
|
const model = ChaseGameModel.createWithSeed({ seed: 70, difficulty: "normal" }); |
|
|
|
model.newRound(2027, "easy"); |
|
|
|
|
|
|
|
const state = model.getState(); |
|
|
|
expect(state.snapshot.seed).toBe(2027); |
|
|
|
expect(state.snapshot.difficulty).toBe("easy"); |
|
|
|
}); |
|
|
|
|
|
|
|
it("retryRound resets rng so same move sequence is reproducible", () => { |
|
|
|
const easyRound = { |
|
|
|
snapshot: { |
|
|
|
|