mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Update tests for multi surface support
This commit is contained in:
1 parent
fd741f9b49
commit
9464541d61
1 file changed
+24
-11
@@ -30,18 +30,28 @@ describe("statistics_exporter plugin", function() {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
game_tick: 100,
|
game_tick: 100,
|
||||||
player_count: 3,
|
player_count: 3,
|
||||||
force_flow_statistics: {
|
surface_statistics: {
|
||||||
player: {
|
"nauvis": {
|
||||||
item_production_statistics: {
|
game_flow_statistics: {
|
||||||
input: { "inserter": 10 },
|
pollution_statistics: {
|
||||||
output: { "iron-plate": 24 },
|
input: { "boiler": 2000 },
|
||||||
|
output: { "tree-proxy": 560 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
force_flow_statistics: {
|
||||||
|
player: {
|
||||||
|
item_production_statistics: {
|
||||||
|
input: { "inserter": 10 },
|
||||||
|
output: { "iron-plate": 24 },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
game_flow_statistics: {
|
platforms: {
|
||||||
pollution_statistics: {
|
"platform-1": {
|
||||||
input: { "boiler": 2000 },
|
force: "player",
|
||||||
output: { "tree-proxy": 560 },
|
surface: "nauvis",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -52,11 +62,14 @@ describe("statistics_exporter plugin", function() {
|
|||||||
assert.equal(instance._instancePlayerCount.labels("7357").get(), 3);
|
assert.equal(instance._instancePlayerCount.labels("7357").get(), 3);
|
||||||
assert.equal(instance._instanceGameTicksTotal.labels("7357").get(), 100);
|
assert.equal(instance._instanceGameTicksTotal.labels("7357").get(), 100);
|
||||||
assert.equal(instance._instanceForceFlowStatistics.labels(
|
assert.equal(instance._instanceForceFlowStatistics.labels(
|
||||||
"7357", "player", "item_production_statistics", "input", "inserter").get(),
|
"7357", "nauvis", "player", "item_production_statistics", "input", "inserter").get(),
|
||||||
10);
|
10);
|
||||||
assert.equal(instance._instanceGameFlowStatistics.labels(
|
assert.equal(instance._instanceGameFlowStatistics.labels(
|
||||||
"7357", "pollution_statistics", "input", "boiler").get(),
|
"7357", "nauvis", "pollution_statistics", "input", "boiler").get(),
|
||||||
2000);
|
2000);
|
||||||
|
assert.equal(instance._instancePlatformMapping.labels(
|
||||||
|
"7357", "platform-1", "player", "nauvis").get(),
|
||||||
|
1);
|
||||||
});
|
});
|
||||||
it("should pass on JSON parse errors", async function() {
|
it("should pass on JSON parse errors", async function() {
|
||||||
let string = "An error occured\n";
|
let string = "An error occured\n";
|
||||||
|
|||||||
Reference in new issue
Block a user