moved updateRam to first call to avoid lack of mocks for tests

* added wrapper funcs to simplify updateRam
* added static parser tests and skiped what isnt worker still for next person to try and fix
This commit is contained in:
phyzical
2022-03-31 21:41:19 +08:00
parent d814a81b79
commit 18af3f8413
13 changed files with 846 additions and 487 deletions
@@ -94,7 +94,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
runPotentiallyAsyncFunction(curr, ...args);
runPotentiallyAsyncFunction(curr, ...args);
runPotentiallyAsyncFunction(curr, ...args);
} catch (e) {}
} catch (e) { }
} else {
throw new Error(`Invalid function specified: [${fnDesc}]`);
}
@@ -160,7 +160,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
runPotentiallyAsyncFunction(curr);
runPotentiallyAsyncFunction(curr);
runPotentiallyAsyncFunction(curr);
} catch (e) {}
} catch (e) { }
} else {
throw new Error(`Invalid function specified: [${fnDesc}]`);
}
@@ -293,7 +293,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
it("exec()", async function () {
const f = ["exec"];
jest.spyOn(console, "log").mockImplementation(() => {}); // eslint-disable-line
jest.spyOn(console, "log").mockImplementation(() => { }); // eslint-disable-line
await testNonzeroDynamicRamCost(f);
});