mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
API: make ns.atExit add the callback to an array instead of setting it (#1059)
This commit is contained in:
@@ -105,7 +105,10 @@ test.each([
|
||||
// await script death.
|
||||
const ws = workerScripts.get(pid);
|
||||
expect(ws).toBeDefined();
|
||||
const result = await Promise.race([alerted, new Promise((resolve) => (ws.atExit = resolve))]);
|
||||
const result = await Promise.race([
|
||||
alerted,
|
||||
new Promise<void>((resolve) => (ws!.atExit = new Map([["default", resolve]]))),
|
||||
]);
|
||||
// If an error alert was thrown, we catch it here.
|
||||
expect(result).not.toBeDefined();
|
||||
expect(runningScript.logs).toEqual(expectedLog);
|
||||
|
||||
Reference in New Issue
Block a user