mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
FEATURE: Add "Recent Errors" tab and improved error modal (#2169)
This commit is contained in:
committed by
GitHub
parent
cf72937faf
commit
18f84396e2
@@ -16,6 +16,7 @@ import { SpecialServers } from "../../../src/Server/data/SpecialServers";
|
||||
import { WorkerScript } from "../../../src/Netscript/WorkerScript";
|
||||
import { NetscriptFunctions } from "../../../src/NetscriptFunctions";
|
||||
import type { PositiveInteger } from "../../../src/types";
|
||||
import { ErrorState } from "../../../src/ErrorHandling/ErrorState";
|
||||
|
||||
declare const importActual: (typeof EvaluatorConfig)["doImport"];
|
||||
|
||||
@@ -118,6 +119,7 @@ const runOptions = {
|
||||
describe("runScript and runScriptFromScript", () => {
|
||||
let alertDelete: () => void;
|
||||
let alerted: Promise<unknown>;
|
||||
let errorShown: Promise<unknown>;
|
||||
|
||||
beforeEach(() => {
|
||||
setupBasicTestingEnvironment();
|
||||
@@ -127,6 +129,9 @@ describe("runScript and runScriptFromScript", () => {
|
||||
alerted = new Promise((resolve) => {
|
||||
alertDelete = AlertEvents.subscribe((x) => resolve(x));
|
||||
});
|
||||
errorShown = new Promise((resolve) => {
|
||||
ErrorState.ErrorUpdate.subscribe((x) => resolve(x));
|
||||
});
|
||||
});
|
||||
afterEach(() => {
|
||||
alertDelete();
|
||||
@@ -215,7 +220,7 @@ describe("runScript and runScriptFromScript", () => {
|
||||
throw new Error(`Invalid worker script`);
|
||||
}
|
||||
const result = await Promise.race([
|
||||
alerted,
|
||||
errorShown,
|
||||
new Promise<void>((resolve) => (workerScript.atExit = new Map([["default", resolve]]))),
|
||||
]);
|
||||
expect(result).toBeDefined();
|
||||
|
||||
Reference in New Issue
Block a user