mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 19:37:07 +02:00
MISC: Support JSX, TS, TSX script files (#1216)
This commit is contained in:
@@ -72,7 +72,6 @@ describe("Netscript RAM Calculation/Generation Tests", function () {
|
||||
extraLayerCost = 0,
|
||||
) {
|
||||
const code = `${fnPath.join(".")}();\n`.repeat(3);
|
||||
const filename = "testfile.js" as ScriptFilePath;
|
||||
const fnName = fnPath[fnPath.length - 1];
|
||||
const server = "testserver";
|
||||
|
||||
@@ -80,7 +79,7 @@ describe("Netscript RAM Calculation/Generation Tests", function () {
|
||||
expect(getRamCost(fnPath, true)).toEqual(expectedRamCost);
|
||||
|
||||
// Static ram check
|
||||
const staticCost = calculateRamUsage(code, filename, new Map(), server).cost;
|
||||
const staticCost = calculateRamUsage(code, `${fnName}.js` as ScriptFilePath, server, new Map()).cost;
|
||||
expect(staticCost).toBeCloseTo(Math.min(baseCost + expectedRamCost + extraLayerCost, maxCost));
|
||||
|
||||
// reset workerScript for dynamic check
|
||||
|
||||
Reference in New Issue
Block a user