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

View File

@@ -6,8 +6,12 @@ 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";
import { fixDoImportIssue } from "./Utilities";
jest.useFakeTimers();
fixDoImportIssue();
// Direct tests of loading and saving.
// Tests here should try to be comprehensive (cover as much stuff as possible)
// without requiring burdensome levels of maintenance when legitimate changes
@@ -98,7 +102,7 @@ function loadStandardServers() {
{
"ctor": "Script",
"data": {
"code": "/** @param {NS} ns */\\nexport async function main(ns) {\\n return ns.asleep(1000000);\\n}",
"code": "/** @param {NS} ns */\nexport async function main(ns) {\n return ns.asleep(1000000);\n}",
"filename": "script.js",
"module": {},
"dependencies": [