Commit Graph

5 Commits

Author SHA1 Message Date
catloversg a703e8753b JEST: Refactor tests that add home server manually (#2358) 2025-10-21 20:57:14 -04:00
catloversg 020b185377 JEST: Enable restoreMocks option and fix lint errors (#2333)
* JEST: Enable restoreMocks option and fix lint errors

* Fix test\jest\Save.test.ts
2025-10-04 14:38:50 -07:00
David Walker 06553d9700 BUGFIX: Fix "Router called before initialization" race (#1474)
If the game takes long enough to load, certain counters can become
eligible to run as soon as Engine.start() runs. When this happens,
eventually Router.page() is called, which throws an Error since Router
isn't initialized yet. (Dropping a breakpoint before Engine.start() and
waiting at least 30 seconds is enough to reliably repro, but I have seen
this both live and in tests.)

This fixes it so that Router.page() is valid immediately, returning a
value of Page.LoadingScreen. It also removes the isInitialized field,
since this is now redundant. Trying to switch pages is still an error,
but that doesn't happen without user input, whereas checking the current
page is quite common.

This also consolidates a check for "should we show toasts" behind a
function in Router, making the logic central and equal for a few
usecases. This means (for instance) that the "autosave is disabled"
logic won't run during infiltration. (The toast should have already been
suppressed.)
2024-07-07 22:13:37 -07:00
Snarling 91105c6d8c TESTS: Prevent some test spam (#1126) 2024-02-26 08:22:33 -05:00
Michael Ficocelli 79b677973b MESSAGES: Re-implement limit on Icarus messages after a bitnode is completed (#742) 2023-08-28 14:38:15 -04:00