mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Replace the remaining places in the codebase using phin with fetch. With the exception of HttpCloser which uses the http/https request method instead.
28 lines
951 B
JavaScript
28 lines
951 B
JavaScript
"use strict";
|
|
const assert = require("assert").strict;
|
|
|
|
const routes = require("../dist/node/routes");
|
|
const { get } = require("../../../test/integration");
|
|
|
|
|
|
describe("subspace_storage endpoints", function() {
|
|
describe("GET /api/inventory", function() {
|
|
it("should return the controllers current inventory", async function() {
|
|
let res = await get("/api/inventory");
|
|
let inventory = await res.json();
|
|
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");
|
|
});
|
|
});
|
|
});
|