Files
factorio-clusterio/plugins/subspace_storage/test/routes.js
T
Hornwitser 38c60c221f Use sub-processes in integration testing
Spawn master, slave, and clusterctl in separate processes in the
clusterio integration tests and leave the test master and slave process
available for the whole test duration to allow plugins to use them as
well.  This removes the need for reimplementing the startup logic in the
test code and makes the existing startup code covered by tests.
2020-03-22 02:10:54 +01:00

25 lines
899 B
JavaScript

const assert = require("assert").strict;
const routes = require("../routes");
const { get } = require("../../../test/integration");
describe("subspace_storage endpoints", function() {
describe("GET /api/inventory", function() {
it("should return the masters current inventory", async function() {
let res = await get("/api/inventory");
let inventory = res.body;
assert.equal(typeof inventory, "object", "Inventory should be an object");
return; // XXX Disabled until a suitable test interface is added.
assert(inventory.length >= 1, "There should be at least 1 entry in the inventory");
let contains20SteelPlate = false;
inventory.forEach(itemStack => {
if(itemStack.name == "steel-plate" && itemStack.count >= 20) contains20SteelPlate = true;
});
assert(contains20SteelPlate, "Please ensure there are at least 20 steel plate in the inventory")
});
});
});