mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +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 = {
|
module.exports = {
|
||||||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "d.ts"],
|
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
|
||||||
transform: {
|
transform: {
|
||||||
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
|
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
|
||||||
},
|
},
|
||||||
|
@ -41,7 +41,10 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
|||||||
* @param {(...args: unknown[]) => unknown} fn
|
* @param {(...args: unknown[]) => unknown} fn
|
||||||
* @param {unknown[]} args
|
* @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);
|
const res = fn(...args);
|
||||||
if (res instanceof Promise) {
|
if (res instanceof Promise) {
|
||||||
res.catch(() => undefined);
|
res.catch(() => undefined);
|
||||||
@ -82,7 +85,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
|||||||
|
|
||||||
// Run the function through the workerscript's args
|
// Run the function through the workerscript's args
|
||||||
const scope = workerScript.env.vars;
|
const scope = workerScript.env.vars;
|
||||||
let curr = fnDesc.reduce((prev, curr) => {
|
const curr = fnDesc.reduce((prev, curr) => {
|
||||||
try {
|
try {
|
||||||
return prev[curr];
|
return prev[curr];
|
||||||
} catch {
|
} catch {
|
||||||
@ -143,7 +146,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
|||||||
|
|
||||||
// Run the function through the workerscript's args
|
// Run the function through the workerscript's args
|
||||||
const scope = workerScript.env.vars;
|
const scope = workerScript.env.vars;
|
||||||
let curr = fnDesc.reduce((prev, curr) => {
|
const curr = fnDesc.reduce((prev, curr) => {
|
||||||
try {
|
try {
|
||||||
return prev[curr];
|
return prev[curr];
|
||||||
} catch {
|
} 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 { RamCostConstants } from "../../../src/Netscript/RamCostGenerator";
|
||||||
import { calculateRamUsage } from "../../../src/Script/RamCalculations";
|
import { calculateRamUsage } from "../../../src/Script/RamCalculations";
|
||||||
import { Script } from "../../../src/Script/Script";
|
import { Script } from "../../../src/Script/Script";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { numeralWrapper } from "../../../src/ui/numeralFormat";
|
import { numeralWrapper } from "../../../src/ui/numeralFormat";
|
||||||
|
|
||||||
let decimalFormat = "0.[000000]";
|
const decimalFormat = "0.[000000]";
|
||||||
|
|
||||||
describe("Numeral formatting for positive numbers", () => {
|
describe("Numeral formatting for positive numbers", () => {
|
||||||
test("should not format too small numbers", () => {
|
test("should not format too small numbers", () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user