mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
Fix renamed functions from 1.0 release in tests
This commit is contained in:
@@ -9,6 +9,11 @@ jest.mock(`!!raw-loader!../NetscriptDefinitions.d.ts`, () => '', {
|
||||
virtual: true,
|
||||
});
|
||||
|
||||
jest.mock("../../src/Netscript/killWorkerScript", () => ({
|
||||
__esModule: true,
|
||||
killWorkerScript: jest.fn(),
|
||||
}));
|
||||
|
||||
const ScriptBaseCost = RamCostConstants.ScriptBaseRamCost;
|
||||
|
||||
describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
||||
@@ -158,7 +163,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
||||
runPotentiallyAsyncFunction(curr);
|
||||
} catch (e) {}
|
||||
} else {
|
||||
throw new Error(`Invalid function specified: [${fndesc}]`);
|
||||
throw new Error(`Invalid function specified: [${fnDesc}]`);
|
||||
}
|
||||
|
||||
testEquality(workerScript.dynamicRamUsage, ScriptBaseCost);
|
||||
@@ -192,13 +197,13 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("hackAnalyzePercent()", async function () {
|
||||
const f = ["hackAnalyzePercent"];
|
||||
it("hackAnalyze()", async function () {
|
||||
const f = ["hackAnalyze"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("hackChance()", async function () {
|
||||
const f = ["hackChance"];
|
||||
it("hackAnalyzeChance()", async function () {
|
||||
const f = ["hackAnalyzeChance"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
@@ -289,6 +294,7 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
||||
|
||||
it("exec()", async function () {
|
||||
const f = ["exec"];
|
||||
jest.spyOn(console, 'log').mockImplementation(() => {}); // eslint-disable-line
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
@@ -454,32 +460,32 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
||||
|
||||
it("write()", async function () {
|
||||
const f = ["write"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
await testZeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("tryWrite()", async function () {
|
||||
const f = ["tryWrite"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
it("tryWritePort()", async function () {
|
||||
const f = ["tryWritePort"];
|
||||
await testZeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("read()", async function () {
|
||||
const f = ["read"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
await testZeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("peek()", async function () {
|
||||
const f = ["peek"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
await testZeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("clear()", async function () {
|
||||
const f = ["clear"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
await testZeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getPortHandle()", async function () {
|
||||
const f = ["getPortHandle"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
await testZeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("rm()", async function () {
|
||||
@@ -581,88 +587,88 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
||||
});
|
||||
|
||||
describe("TIX API", function () {
|
||||
it("getStockSymbols()", async function () {
|
||||
const f = ["getStockSymbols"];
|
||||
it("stock.getSymbols()", async function () {
|
||||
const f = ["stock", "getSymbols"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getStockPrice()", async function () {
|
||||
const f = ["getStockPrice"];
|
||||
it("stock.getPrice()", async function () {
|
||||
const f = ["stock", "getPrice"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getStockAskPrice()", async function () {
|
||||
const f = ["getStockAskPrice"];
|
||||
it("stock.getBidPrice()", async function () {
|
||||
const f = ["stock", "getBidPrice"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getStockBidPrice()", async function () {
|
||||
const f = ["getStockBidPrice"];
|
||||
it("stock.getBidPrice()", async function () {
|
||||
const f = ["stock", "getBidPrice"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getStockPosition()", async function () {
|
||||
const f = ["getStockPosition"];
|
||||
it("stock.getPosition()", async function () {
|
||||
const f = ["stock", "getPosition"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getStockMaxShares()", async function () {
|
||||
const f = ["getStockMaxShares"];
|
||||
it("stock.getMaxShares()", async function () {
|
||||
const f = ["stock", "getMaxShares"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("buyStock()", async function () {
|
||||
const f = ["buyStock"];
|
||||
it("stock.buy()", async function () {
|
||||
const f = ["stock", "buy"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("sellStock()", async function () {
|
||||
const f = ["sellStock"];
|
||||
it("stock.sell()", async function () {
|
||||
const f = ["stock", "sell"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("shortStock()", async function () {
|
||||
const f = ["shortStock"];
|
||||
it("stock.short()", async function () {
|
||||
const f = ["stock", "short"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("sellShort()", async function () {
|
||||
const f = ["sellShort"];
|
||||
it("stock.sellShort()", async function () {
|
||||
const f = ["stock", "sellShort"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("placeOrder()", async function () {
|
||||
const f = ["placeOrder"];
|
||||
it("stock.placeOrder()", async function () {
|
||||
const f = ["stock", "placeOrder"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("cancelOrder()", async function () {
|
||||
const f = ["cancelOrder"];
|
||||
it("stock.cancelOrder()", async function () {
|
||||
const f = ["stock", "cancelOrder"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getOrders()", async function () {
|
||||
const f = ["getOrders"];
|
||||
it("stock.getOrders()", async function () {
|
||||
const f = ["stock", "getOrders"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getStockVolatility()", async function () {
|
||||
const f = ["getStockVolatility"];
|
||||
it("stock.getVolatility()", async function () {
|
||||
const f = ["stock", "getVolatility"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getStockForecast()", async function () {
|
||||
const f = ["getStockForecast"];
|
||||
it("stock.getForecast()", async function () {
|
||||
const f = ["stock", "getForecast"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("purchase4SMarketData()", async function () {
|
||||
const f = ["purchase4SMarketData"];
|
||||
it("stock.purchase4SMarketData()", async function () {
|
||||
const f = ["stock", "purchase4SMarketData"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("purchase4SMarketDataTixApi()", async function () {
|
||||
const f = ["purchase4SMarketDataTixApi"];
|
||||
it("stock.purchase4SMarketDataTixApi()", async function () {
|
||||
const f = ["stock", "purchase4SMarketDataTixApi"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
});
|
||||
@@ -975,11 +981,6 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () {
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getCityEstimatedCommunities()", async function () {
|
||||
const f = ["bladeburner", "getCityEstimatedCommunities"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
});
|
||||
|
||||
it("getCityChaos()", async function () {
|
||||
const f = ["bladeburner", "getCityChaos"];
|
||||
await testNonzeroDynamicRamCost(f);
|
||||
|
||||
Reference in New Issue
Block a user