Browse Source

test(chase): assert newRound snapshot uses provided seed and difficulty

Made-with: Cursor
master
npmrun 2 weeks ago
parent
commit
2cbf6ece7a
  1. 13
      tests/chase/chaseModel.test.ts

13
tests/chase/chaseModel.test.ts

@ -191,6 +191,19 @@ describe("chase game model", () => {
expect(state.turn).toBe(0); 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", () => { it("retryRound resets rng so same move sequence is reproducible", () => {
const easyRound = { const easyRound = {
snapshot: { snapshot: {

Loading…
Cancel
Save