JEST: Enable restoreMocks option and fix lint errors (#2333)

* JEST: Enable restoreMocks option and fix lint errors

* Fix test\jest\Save.test.ts
This commit is contained in:
catloversg
2025-10-05 04:38:50 +07:00
committed by GitHub
parent 18b062663d
commit 020b185377
14 changed files with 173 additions and 129 deletions
+6 -1
View File
@@ -25,6 +25,9 @@ test("Edge cases of disableLog", function () {
const ws = new WorkerScript(runningScript, 1, NetscriptFunctions);
const ns = ws.env.vars;
if (!ns) {
throw new Error("Invalid ws.env.vars");
}
// Generate logs in a specific pattern that checks edge cases in
// disableLog. We want to check various combinations of things that
@@ -82,6 +85,8 @@ test("Edge cases of disableLog", function () {
"end",
]);
} finally {
DeleteServer(server.hostname);
if (server) {
DeleteServer(server.hostname);
}
}
});