BUGFIX: Running scripts may be loaded before main UI (#1726)

This commit is contained in:
catloversg
2025-07-06 08:10:51 +07:00
committed by GitHub
parent 970292bedb
commit 9b59fcbb5f
7 changed files with 159 additions and 39 deletions

View File

@@ -5,6 +5,7 @@ import { loadAllRunningScripts } from "../../src/NetscriptWorker";
import { Settings } from "../../src/Settings/Settings";
import { Player, setPlayer } from "../../src/Player";
import { PlayerObject } from "../../src/PersonObjects/Player/PlayerObject";
import { UIEventEmitter, UIEventType } from "../../src/ui/UIEventEmitter";
jest.useFakeTimers();
// Direct tests of loading and saving.
@@ -146,6 +147,7 @@ function loadStandardServers() {
}
}`); // Fix confused highlighting `
loadAllRunningScripts();
UIEventEmitter.emit(UIEventType.MainUILoaded);
}
test("load/saveAllServers", () => {