mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 08:43:53 +01:00
attempt2
For some reason only 3/9 tests running locally
This commit is contained in:
parent
3addda7173
commit
94a8c7ca64
@ -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",
|
||||
},
|
||||
|
@ -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 {
|
||||
|
@ -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";
|
||||
|
@ -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", () => {
|
||||
|
Loading…
Reference in New Issue
Block a user