From 94a8c7ca64abc69661cb1e1ef51ee0a81ee6f569 Mon Sep 17 00:00:00 2001 From: Snarling <84951833+Snarling@users.noreply.github.com> Date: Sat, 1 Oct 2022 15:28:48 -0400 Subject: [PATCH] attempt2 For some reason only 3/9 tests running locally --- jest.config.js | 2 +- test/jest/Netscript/DynamicRamCalculation.test.ts | 9 ++++++--- test/jest/Netscript/StaticRamParsingCalculation.test.ts | 3 --- test/jest/ui/nFormat.test.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jest.config.js b/jest.config.js index 42e457da3..25c9858c2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ module.exports = { - moduleFileExtensions: ["ts", "tsx", "js", "jsx", "d.ts"], + moduleFileExtensions: ["ts", "tsx", "js", "jsx"], transform: { "^.+\\.(js|jsx|ts|tsx)$": "babel-jest", }, diff --git a/test/jest/Netscript/DynamicRamCalculation.test.ts b/test/jest/Netscript/DynamicRamCalculation.test.ts index a4fe0248e..8e4920022 100644 --- a/test/jest/Netscript/DynamicRamCalculation.test.ts +++ b/test/jest/Netscript/DynamicRamCalculation.test.ts @@ -41,7 +41,10 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () { * @param {(...args: unknown[]) => unknown} fn * @param {unknown[]} args */ - function runPotentiallyAsyncFunction(fn: Function, ...args: (string | number | boolean)[]) { + function runPotentiallyAsyncFunction( + fn: (...args: (string | number | boolean)[]) => unknown, + ...args: (string | number | boolean)[] + ) { const res = fn(...args); if (res instanceof Promise) { res.catch(() => undefined); @@ -82,7 +85,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () { // Run the function through the workerscript's args const scope = workerScript.env.vars; - let curr = fnDesc.reduce((prev, curr) => { + const curr = fnDesc.reduce((prev, curr) => { try { return prev[curr]; } catch { @@ -143,7 +146,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () { // Run the function through the workerscript's args const scope = workerScript.env.vars; - let curr = fnDesc.reduce((prev, curr) => { + const curr = fnDesc.reduce((prev, curr) => { try { return prev[curr]; } catch { diff --git a/test/jest/Netscript/StaticRamParsingCalculation.test.ts b/test/jest/Netscript/StaticRamParsingCalculation.test.ts index c313a0c88..950137f53 100644 --- a/test/jest/Netscript/StaticRamParsingCalculation.test.ts +++ b/test/jest/Netscript/StaticRamParsingCalculation.test.ts @@ -1,6 +1,3 @@ -// Player is needed for calculating costs like Singularity functions, that depend on acquired source files -import { Player } from "../../../src/Player"; - import { RamCostConstants } from "../../../src/Netscript/RamCostGenerator"; import { calculateRamUsage } from "../../../src/Script/RamCalculations"; import { Script } from "../../../src/Script/Script"; diff --git a/test/jest/ui/nFormat.test.ts b/test/jest/ui/nFormat.test.ts index e07a6254d..a66c70399 100644 --- a/test/jest/ui/nFormat.test.ts +++ b/test/jest/ui/nFormat.test.ts @@ -1,6 +1,6 @@ import { numeralWrapper } from "../../../src/ui/numeralFormat"; -let decimalFormat = "0.[000000]"; +const decimalFormat = "0.[000000]"; describe("Numeral formatting for positive numbers", () => { test("should not format too small numbers", () => {