Update tests for multi surface support

This commit is contained in:
Danielv123 committed 2024-12-02 21:14:50 +00:00
1 parent fd741f9b49
commit 9464541d61
1 file changed
+24 -11
+24 -11
View File
@@ -30,18 +30,28 @@ describe("statistics_exporter plugin", function() {
JSON.stringify({
game_tick: 100,
player_count: 3,
force_flow_statistics: {
player: {
item_production_statistics: {
input: { "inserter": 10 },
output: { "iron-plate": 24 },
surface_statistics: {
"nauvis": {
game_flow_statistics: {
pollution_statistics: {
input: { "boiler": 2000 },
output: { "tree-proxy": 560 },
},
},
force_flow_statistics: {
player: {
item_production_statistics: {
input: { "inserter": 10 },
output: { "iron-plate": 24 },
},
},
},
},
},
game_flow_statistics: {
pollution_statistics: {
input: { "boiler": 2000 },
output: { "tree-proxy": 560 },
platforms: {
"platform-1": {
force: "player",
surface: "nauvis",
},
},
})
@@ -52,11 +62,14 @@ describe("statistics_exporter plugin", function() {
assert.equal(instance._instancePlayerCount.labels("7357").get(), 3);
assert.equal(instance._instanceGameTicksTotal.labels("7357").get(), 100);
assert.equal(instance._instanceForceFlowStatistics.labels(
"7357", "player", "item_production_statistics", "input", "inserter").get(),
"7357", "nauvis", "player", "item_production_statistics", "input", "inserter").get(),
10);
assert.equal(instance._instanceGameFlowStatistics.labels(
"7357", "pollution_statistics", "input", "boiler").get(),
"7357", "nauvis", "pollution_statistics", "input", "boiler").get(),
2000);
assert.equal(instance._instancePlatformMapping.labels(
"7357", "platform-1", "player", "nauvis").get(),
1);
});
it("should pass on JSON parse errors", async function() {
let string = "An error occured\n";