mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 16:13:12 +09:00
Add dangling commas
Ensure multiline object and array litterals are consistenly typed out with dangling commas for the last element.
This commit is contained in:
1 parent
3e4f0b6b5e
commit
8cb21c5fa8
16 files changed
+69
-69
No files matched your search
+6
-6
@@ -202,10 +202,10 @@ commands.push(new Command({
|
|||||||
yargs.option("id", { type: "number", nargs: 1, describe: "Slave id", default: null });
|
yargs.option("id", { type: "number", nargs: 1, describe: "Slave id", default: null });
|
||||||
yargs.option("name", { type: "string", nargs: 1, describe: "Slave name", default: null });
|
yargs.option("name", { type: "string", nargs: 1, describe: "Slave name", default: null });
|
||||||
yargs.option("generate-token", {
|
yargs.option("generate-token", {
|
||||||
type: "boolean", nargs: 0, describe: "Generate authentication token", default: false
|
type: "boolean", nargs: 0, describe: "Generate authentication token", default: false,
|
||||||
});
|
});
|
||||||
yargs.option("output", {
|
yargs.option("output", {
|
||||||
type: "string", nargs: 1, describe: "Path to output config (- for stdout)", default: "config-slave.json"
|
type: "string", nargs: 1, describe: "Path to output config (- for stdout)", default: "config-slave.json",
|
||||||
});
|
});
|
||||||
}],
|
}],
|
||||||
handler: async function(args, control) {
|
handler: async function(args, control) {
|
||||||
@@ -236,7 +236,7 @@ commands.push(new Command({
|
|||||||
handler: async function(args, control) {
|
handler: async function(args, control) {
|
||||||
let response = await link.messages.listInstances.send(control);
|
let response = await link.messages.listInstances.send(control);
|
||||||
console.log(asTable(response.list));
|
console.log(asTable(response.list));
|
||||||
}
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
commands.push(new Command({
|
commands.push(new Command({
|
||||||
@@ -258,7 +258,7 @@ commands.push(new Command({
|
|||||||
type: "boolean",
|
type: "boolean",
|
||||||
nargs: 0,
|
nargs: 0,
|
||||||
describe: "Specify this is a base config",
|
describe: "Specify this is a base config",
|
||||||
group: "Instance Config:"
|
group: "Instance Config:",
|
||||||
});
|
});
|
||||||
}],
|
}],
|
||||||
handler: async function(args, control) {
|
handler: async function(args, control) {
|
||||||
@@ -433,7 +433,7 @@ commands.push(new Command({
|
|||||||
handler: async function(args, control) {
|
handler: async function(args, control) {
|
||||||
let response = await link.messages.sendRcon.send(control, {
|
let response = await link.messages.sendRcon.send(control, {
|
||||||
instance_id: await resolveInstance(control, args.instance),
|
instance_id: await resolveInstance(control, args.instance),
|
||||||
command: args.command
|
command: args.command,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Factorio includes a newline in it's response output.
|
// Factorio includes a newline in it's response output.
|
||||||
@@ -469,7 +469,7 @@ commands.push(new Command({
|
|||||||
let response = await link.messages.createRole.send(control, {
|
let response = await link.messages.createRole.send(control, {
|
||||||
name: args.name,
|
name: args.name,
|
||||||
description: args.description,
|
description: args.description,
|
||||||
permissions: args.permissions
|
permissions: args.permissions,
|
||||||
});
|
});
|
||||||
console.log(`Created role ID ${response.id}`);
|
console.log(`Created role ID ${response.id}`);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ MasterGroup.define({
|
|||||||
title: "HTTP Port",
|
title: "HTTP Port",
|
||||||
description: "Port to listen for HTTP connections on, set to null to not listen for HTTP connections.",
|
description: "Port to listen for HTTP connections on, set to null to not listen for HTTP connections.",
|
||||||
type: "number",
|
type: "number",
|
||||||
optional: true
|
optional: true,
|
||||||
});
|
});
|
||||||
MasterGroup.define({
|
MasterGroup.define({
|
||||||
name: "https_port",
|
name: "https_port",
|
||||||
@@ -139,7 +139,7 @@ SlaveGroup.define({
|
|||||||
name: "factorio_directory",
|
name: "factorio_directory",
|
||||||
description: "Path to directory to look for factorio installs",
|
description: "Path to directory to look for factorio installs",
|
||||||
type: "string",
|
type: "string",
|
||||||
initial_value: "factorio"
|
initial_value: "factorio",
|
||||||
});
|
});
|
||||||
SlaveGroup.define({
|
SlaveGroup.define({
|
||||||
name: "instances_directory",
|
name: "instances_directory",
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ const outputHeuristics = [
|
|||||||
filter: { type: "log", message: /^updateTick\(\d+\) changing state from\(CreatingGame\) to\(InGame\)$/ },
|
filter: { type: "log", message: /^updateTick\(\d+\) changing state from\(CreatingGame\) to\(InGame\)$/ },
|
||||||
action: function(output) {
|
action: function(output) {
|
||||||
this._notifyGameReady().catch((err) => { this.emit("error", err); });
|
this._notifyGameReady().catch((err) => { this.emit("error", err); });
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Message indicating the server has started an autosave
|
// Message indicating the server has started an autosave
|
||||||
@@ -414,14 +414,14 @@ const outputHeuristics = [
|
|||||||
},
|
},
|
||||||
action: function(output) {
|
action: function(output) {
|
||||||
this.emit("_saved");
|
this.emit("_saved");
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Message indicating the server is shutting down
|
// Message indicating the server is shutting down
|
||||||
{
|
{
|
||||||
filter: {
|
filter: {
|
||||||
type: "generic",
|
type: "generic",
|
||||||
message: /^Quitting: /
|
message: /^Quitting: /,
|
||||||
},
|
},
|
||||||
action: function(output) {
|
action: function(output) {
|
||||||
this.emit("_quitting");
|
this.emit("_quitting");
|
||||||
@@ -432,7 +432,7 @@ const outputHeuristics = [
|
|||||||
if (process.platform === "win32" && output.message === "Quitting: multiplayer error.") {
|
if (process.platform === "win32" && output.message === "Quitting: multiplayer error.") {
|
||||||
this._server.kill();
|
this._server.kill();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Messages that might be tha cause of an unexpected shutdown.
|
// Messages that might be tha cause of an unexpected shutdown.
|
||||||
@@ -1047,7 +1047,7 @@ class FactorioServer extends events.EventEmitter {
|
|||||||
path: {
|
path: {
|
||||||
"read-data": this.dataPath(),
|
"read-data": this.dataPath(),
|
||||||
"write-data": this.writePath(),
|
"write-data": this.writePath(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await fs.outputFile(this.writePath("config.ini"), content);
|
await fs.outputFile(this.writePath("config.ini"), content);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class Request extends Message {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ messages.sendRcon = new Request({
|
|||||||
},
|
},
|
||||||
responseProperties: {
|
responseProperties: {
|
||||||
"result": { type: "string" },
|
"result": { type: "string" },
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
messages.listPermissions = new Request({
|
messages.listPermissions = new Request({
|
||||||
@@ -503,7 +503,7 @@ messages.createRole = new Request({
|
|||||||
},
|
},
|
||||||
responseProperties: {
|
responseProperties: {
|
||||||
"id": { type: "integer" },
|
"id": { type: "integer" },
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
messages.updateRole = new Request({
|
messages.updateRole = new Request({
|
||||||
@@ -697,7 +697,7 @@ class Event extends Message {
|
|||||||
if (
|
if (
|
||||||
this.broadcastTo === "instance"
|
this.broadcastTo === "instance"
|
||||||
&& [
|
&& [
|
||||||
"instance-slave", "slave-master", "control-master", "master-slave"
|
"instance-slave", "slave-master", "control-master", "master-slave",
|
||||||
].includes(`${link.target}-${link.source}`)
|
].includes(`${link.target}-${link.source}`)
|
||||||
) {
|
) {
|
||||||
if (!handler) {
|
if (!handler) {
|
||||||
@@ -759,7 +759,7 @@ messages.instanceInitialized = new Event({
|
|||||||
"plugins": {
|
"plugins": {
|
||||||
type: "object",
|
type: "object",
|
||||||
additionalProperties: { type: "string" },
|
additionalProperties: { type: "string" },
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
messages.instanceStarted = new Event({
|
messages.instanceStarted = new Event({
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ async function listMods(config, instance) {
|
|||||||
factorioAPI.authenticate({
|
factorioAPI.authenticate({
|
||||||
username: config.username,
|
username: config.username,
|
||||||
token: config.token,
|
token: config.token,
|
||||||
require_ownership: false
|
require_ownership: false,
|
||||||
}).then(token => {
|
}).then(token => {
|
||||||
console.log("* Currently installed:");
|
console.log("* Currently installed:");
|
||||||
factorioAPI.readModZips().then(list => {
|
factorioAPI.readModZips().then(list => {
|
||||||
@@ -84,7 +84,7 @@ async function listMods(config, instance) {
|
|||||||
factorioAPI.authenticate({
|
factorioAPI.authenticate({
|
||||||
username: config.username,
|
username: config.username,
|
||||||
token: config.token,
|
token: config.token,
|
||||||
require_ownership: false
|
require_ownership: false,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.log("\r\n");
|
console.log("\r\n");
|
||||||
console.log("* Mods shared by all instances:");
|
console.log("* Mods shared by all instances:");
|
||||||
@@ -119,7 +119,7 @@ async function findMods(config, searchTerm) {
|
|||||||
factorioAPI.authenticate({
|
factorioAPI.authenticate({
|
||||||
username: config.username,
|
username: config.username,
|
||||||
token: config.token,
|
token: config.token,
|
||||||
require_ownership: false
|
require_ownership: false,
|
||||||
}).then(token => {
|
}).then(token => {
|
||||||
factorioAPI.searchMods(searchTerm).then(mods => {
|
factorioAPI.searchMods(searchTerm).then(mods => {
|
||||||
let result = asTable(mods.reverse().map(mod => {
|
let result = asTable(mods.reverse().map(mod => {
|
||||||
@@ -157,7 +157,7 @@ async function addMod(config, term, instance) {
|
|||||||
factorioAPI.authenticate({
|
factorioAPI.authenticate({
|
||||||
username: config.username,
|
username: config.username,
|
||||||
token: config.token,
|
token: config.token,
|
||||||
require_ownership: false
|
require_ownership: false,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
factorioAPI.searchMods(term.split("/")[term.split("/").length-1]).then(body => {
|
factorioAPI.searchMods(term.split("/")[term.split("/").length-1]).then(body => {
|
||||||
console.log("Im gonna download: "+body[0].name + " in version: " + body[0].latest_release.version);
|
console.log("Im gonna download: "+body[0].name + " in version: " + body[0].latest_release.version);
|
||||||
@@ -202,7 +202,7 @@ async function addMod(config, term, instance) {
|
|||||||
factorioAPI.authenticate({
|
factorioAPI.authenticate({
|
||||||
username: config.username,
|
username: config.username,
|
||||||
token: config.token,
|
token: config.token,
|
||||||
require_ownership: false
|
require_ownership: false,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
factorioAPI.searchMods(term).then(body => {
|
factorioAPI.searchMods(term).then(body => {
|
||||||
console.log(body);
|
console.log(body);
|
||||||
|
|||||||
+2
-2
@@ -88,7 +88,7 @@ const serverHandshake = ajv.compile({
|
|||||||
type: "object",
|
type: "object",
|
||||||
additionalProperties: { type: "string" },
|
additionalProperties: { type: "string" },
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -169,7 +169,7 @@ const clientHandshake = ajv.compile({
|
|||||||
"token": { type: "string" },
|
"token": { type: "string" },
|
||||||
"agent": { type: "string" },
|
"agent": { type: "string" },
|
||||||
"version": { type: "string" },
|
"version": { type: "string" },
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ app.use(bodyParser.json({
|
|||||||
app.use(bodyParser.urlencoded({
|
app.use(bodyParser.urlencoded({
|
||||||
parameterLimit: 100000,
|
parameterLimit: 100000,
|
||||||
limit: "10mb",
|
limit: "10mb",
|
||||||
extended: true
|
extended: true,
|
||||||
}));
|
}));
|
||||||
app.use(fileUpload());
|
app.use(fileUpload());
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
@@ -1220,7 +1220,7 @@ wss.on("connection", function (socket, req) {
|
|||||||
// Start connection handshake.
|
// Start connection handshake.
|
||||||
socket.send(JSON.stringify({ seq: null, type: "hello", data: {
|
socket.send(JSON.stringify({ seq: null, type: "hello", data: {
|
||||||
version,
|
version,
|
||||||
plugins: pluginList
|
plugins: pluginList,
|
||||||
}}));
|
}}));
|
||||||
|
|
||||||
function attachHandler() {
|
function attachHandler() {
|
||||||
@@ -1350,7 +1350,7 @@ async function handleHandshake(message, socket, req, attachHandler) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let sessionId = nextSessionId++;
|
let sessionId = nextSessionId++;
|
||||||
let sessionToken = jwt.sign({ aud: masterSession, sid: sessionId, }, masterConfig.get("master.auth_secret"));
|
let sessionToken = jwt.sign({ aud: masterSession, sid: sessionId }, masterConfig.get("master.auth_secret"));
|
||||||
let connector = new WebSocketServerConnector(socket, sessionId);
|
let connector = new WebSocketServerConnector(socket, sessionId);
|
||||||
activeConnectors.set(sessionId, connector);
|
activeConnectors.set(sessionId, connector);
|
||||||
|
|
||||||
@@ -1647,7 +1647,7 @@ async function startServer() {
|
|||||||
|
|
||||||
httpsServer = require("https").createServer({
|
httpsServer = require("https").createServer({
|
||||||
key: privateKey,
|
key: privateKey,
|
||||||
cert: certificate
|
cert: certificate,
|
||||||
}, app);
|
}, app);
|
||||||
await listen(httpsServer, httpsPort);
|
await listen(httpsServer, httpsPort);
|
||||||
console.log("Listening for HTTPS on port %s...", httpsServer.address().port);
|
console.log("Listening for HTTPS on port %s...", httpsServer.address().port);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const technologies = {
|
|||||||
{ type: "integer" },
|
{ type: "integer" },
|
||||||
{ type: ["null", "number"] },
|
{ type: ["null", "number"] },
|
||||||
{ type: "boolean" },
|
{ type: "boolean" },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -184,5 +184,5 @@ async function saveTechnologies(masterConfig, technologies) {
|
|||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
MasterPlugin
|
MasterPlugin,
|
||||||
};
|
};
|
||||||
@@ -24,16 +24,16 @@ describe("statistics_exporter plugin", function() {
|
|||||||
force_flow_statistics: {
|
force_flow_statistics: {
|
||||||
player: {
|
player: {
|
||||||
item_production_statistics: {
|
item_production_statistics: {
|
||||||
input: { "inserter": 10, },
|
input: { "inserter": 10 },
|
||||||
output: { "iron-plate": 24, }
|
output: { "iron-plate": 24 },
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
game_flow_statistics: {
|
game_flow_statistics: {
|
||||||
pollution_statistics: {
|
pollution_statistics: {
|
||||||
input: { "boiler": 2000 },
|
input: { "boiler": 2000 },
|
||||||
output: { "tree-proxy": 560 },
|
output: { "tree-proxy": 560 },
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class neuralDole {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
items
|
items,
|
||||||
}){
|
}){
|
||||||
// Set some storage variables for the dole divider
|
// Set some storage variables for the dole divider
|
||||||
this.items = items;
|
this.items = items;
|
||||||
@@ -127,5 +127,5 @@ function doleDivider({
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
doleDivider,
|
doleDivider,
|
||||||
neuralDole
|
neuralDole,
|
||||||
};
|
};
|
||||||
@@ -114,7 +114,7 @@ describe("Integration of Clusterio", function() {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
"ignore_player_limit_for_returning_players", true,
|
"ignore_player_limit_for_returning_players", true,
|
||||||
"ignore-player-limit-for-returning-players", "Ignore player limit for returning players: true."
|
"ignore-player-limit-for-returning-players", "Ignore player limit for returning players: true.",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"max_players", 11,
|
"max_players", 11,
|
||||||
|
|||||||
+13
-13
@@ -25,35 +25,35 @@ describe("lib/config/classes", function() {
|
|||||||
for (let [def, error] of [
|
for (let [def, error] of [
|
||||||
[
|
[
|
||||||
{ name: "a", type: "invalid", optional: true },
|
{ name: "a", type: "invalid", optional: true },
|
||||||
"invalid is not a valid type"
|
"invalid is not a valid type",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ name: [], type: "string", optional: true },
|
{ name: [], type: "string", optional: true },
|
||||||
"name must be a string"
|
"name must be a string",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ name: "a", type: "string", enum: true, optional: true },
|
{ name: "a", type: "string", enum: true, optional: true },
|
||||||
"enum must be an array"
|
"enum must be an array",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ name: "a", title: 2, type: "string", optional: true },
|
{ name: "a", title: 2, type: "string", optional: true },
|
||||||
"title must be a string"
|
"title must be a string",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ name: "a", description: 2, type: "string", optional: true },
|
{ name: "a", description: 2, type: "string", optional: true },
|
||||||
"description must be a string"
|
"description must be a string",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ name: "a", type: "string", optional: "yes" },
|
{ name: "a", type: "string", optional: "yes" },
|
||||||
"optional must be a boolean"
|
"optional must be a boolean",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ name: "a", type: "string", initial_value: 1 },
|
{ name: "a", type: "string", initial_value: 1 },
|
||||||
"initial_value must match the type or be a function"
|
"initial_value must match the type or be a function",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ name: "a", type: "string" },
|
{ name: "a", type: "string" },
|
||||||
"Non-optional field a needs an initial_value"
|
"Non-optional field a needs an initial_value",
|
||||||
],
|
],
|
||||||
]) {
|
]) {
|
||||||
assert.throws(() => TestGroup.define(def), new Error(error));
|
assert.throws(() => TestGroup.define(def), new Error(error));
|
||||||
@@ -477,8 +477,8 @@ describe("lib/config/classes", function() {
|
|||||||
{
|
{
|
||||||
name: "beta",
|
name: "beta",
|
||||||
fields: { bar: {} },
|
fields: { bar: {} },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -521,7 +521,7 @@ describe("lib/config/classes", function() {
|
|||||||
{
|
{
|
||||||
name: "beta",
|
name: "beta",
|
||||||
fields: { bar: { value: 20 }},
|
fields: { bar: { value: 20 }},
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
let testInstance = new TestConfig();
|
let testInstance = new TestConfig();
|
||||||
@@ -543,7 +543,7 @@ describe("lib/config/classes", function() {
|
|||||||
{
|
{
|
||||||
name: "beta",
|
name: "beta",
|
||||||
fields: { bar: { value: 30 }},
|
fields: { bar: { value: 30 }},
|
||||||
}
|
},
|
||||||
]}, false);
|
]}, false);
|
||||||
|
|
||||||
assert.deepEqual(testInstance.serialize(), {
|
assert.deepEqual(testInstance.serialize(), {
|
||||||
@@ -559,7 +559,7 @@ describe("lib/config/classes", function() {
|
|||||||
{
|
{
|
||||||
name: "beta",
|
name: "beta",
|
||||||
fields: { bar: { value: 30 }},
|
fields: { bar: { value: 30 }},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+14
-14
@@ -11,7 +11,7 @@ let testLines = new Map([
|
|||||||
level: "Info",
|
level: "Info",
|
||||||
file: "RemoteCommandProcessor.cpp:131",
|
file: "RemoteCommandProcessor.cpp:131",
|
||||||
message: "Starting RCON interface at port 4000",
|
message: "Starting RCON interface at port 4000",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
" 0.622 Warning FileUtil.cpp:527: test not found; using test.zip",
|
" 0.622 Warning FileUtil.cpp:527: test not found; using test.zip",
|
||||||
@@ -22,7 +22,7 @@ let testLines = new Map([
|
|||||||
level: "Warning",
|
level: "Warning",
|
||||||
file: "FileUtil.cpp:527",
|
file: "FileUtil.cpp:527",
|
||||||
message: "test not found; using test.zip",
|
message: "test not found; using test.zip",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
" 0.554 Error Main.cpp:839: require_user_verification must be enabled for public games.",
|
" 0.554 Error Main.cpp:839: require_user_verification must be enabled for public games.",
|
||||||
@@ -33,7 +33,7 @@ let testLines = new Map([
|
|||||||
level: "Error",
|
level: "Error",
|
||||||
file: "Main.cpp:839",
|
file: "Main.cpp:839",
|
||||||
message: "require_user_verification must be enabled for public games.",
|
message: "require_user_verification must be enabled for public games.",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
" 640.910 Quitting: remote-quit.",
|
" 640.910 Quitting: remote-quit.",
|
||||||
@@ -42,7 +42,7 @@ let testLines = new Map([
|
|||||||
time: "640.910",
|
time: "640.910",
|
||||||
type: "generic",
|
type: "generic",
|
||||||
message: "Quitting: remote-quit.",
|
message: "Quitting: remote-quit.",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"1641.421 Goodbye",
|
"1641.421 Goodbye",
|
||||||
@@ -51,7 +51,7 @@ let testLines = new Map([
|
|||||||
time: "1641.421",
|
time: "1641.421",
|
||||||
type: "generic",
|
type: "generic",
|
||||||
message: "Goodbye",
|
message: "Goodbye",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"2019-01-20 10:30:04 [JOIN] User joined the game",
|
"2019-01-20 10:30:04 [JOIN] User joined the game",
|
||||||
@@ -61,7 +61,7 @@ let testLines = new Map([
|
|||||||
type: "action",
|
type: "action",
|
||||||
action: "JOIN",
|
action: "JOIN",
|
||||||
message: "User joined the game",
|
message: "User joined the game",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"2019-01-20 10:30:07 [CHAT] User: chat message",
|
"2019-01-20 10:30:07 [CHAT] User: chat message",
|
||||||
@@ -71,7 +71,7 @@ let testLines = new Map([
|
|||||||
type: "action",
|
type: "action",
|
||||||
action: "CHAT",
|
action: "CHAT",
|
||||||
message: "User: chat message",
|
message: "User: chat message",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"2019-01-20 10:30:14 [COMMAND] User (command): blah",
|
"2019-01-20 10:30:14 [COMMAND] User (command): blah",
|
||||||
@@ -81,7 +81,7 @@ let testLines = new Map([
|
|||||||
type: "action",
|
type: "action",
|
||||||
action: "COMMAND",
|
action: "COMMAND",
|
||||||
message: "User (command): blah",
|
message: "User (command): blah",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"2019-01-20 10:30:14 Cannot execute command. Error: [string \"blah\"]:1: syntax error near <eof>",
|
"2019-01-20 10:30:14 Cannot execute command. Error: [string \"blah\"]:1: syntax error near <eof>",
|
||||||
@@ -90,7 +90,7 @@ let testLines = new Map([
|
|||||||
time: "2019-01-20 10:30:14",
|
time: "2019-01-20 10:30:14",
|
||||||
type: "generic",
|
type: "generic",
|
||||||
message: "Cannot execute command. Error: [string \"blah\"]:1: syntax error near <eof>",
|
message: "Cannot execute command. Error: [string \"blah\"]:1: syntax error near <eof>",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"2019-01-20 10:30:21 [LEAVE] User left the game",
|
"2019-01-20 10:30:21 [LEAVE] User left the game",
|
||||||
@@ -100,7 +100,7 @@ let testLines = new Map([
|
|||||||
type: "action",
|
type: "action",
|
||||||
action: "LEAVE",
|
action: "LEAVE",
|
||||||
message: "User left the game",
|
message: "User left the game",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"Error while running event level::on_nth_tick(1)",
|
"Error while running event level::on_nth_tick(1)",
|
||||||
@@ -108,7 +108,7 @@ let testLines = new Map([
|
|||||||
format: "none",
|
format: "none",
|
||||||
type: "generic",
|
type: "generic",
|
||||||
message: "Error while running event level::on_nth_tick(1)",
|
message: "Error while running event level::on_nth_tick(1)",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"4802.763 Info AppManager.cpp:287: Saving to _autosave4 (blocking).",
|
"4802.763 Info AppManager.cpp:287: Saving to _autosave4 (blocking).",
|
||||||
@@ -119,7 +119,7 @@ let testLines = new Map([
|
|||||||
level: "Info",
|
level: "Info",
|
||||||
file: "AppManager.cpp:287",
|
file: "AppManager.cpp:287",
|
||||||
message: "Saving to _autosave4 (blocking).",
|
message: "Saving to _autosave4 (blocking).",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
" 10.806 Info AppManager.cpp:394: Saving game as C:\\factorio\\saves\\world.zip",
|
" 10.806 Info AppManager.cpp:394: Saving game as C:\\factorio\\saves\\world.zip",
|
||||||
@@ -130,7 +130,7 @@ let testLines = new Map([
|
|||||||
level: "Info",
|
level: "Info",
|
||||||
file: "AppManager.cpp:394",
|
file: "AppManager.cpp:394",
|
||||||
message: "Saving game as C:\\factorio\\saves\\world.zip",
|
message: "Saving game as C:\\factorio\\saves\\world.zip",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"4202.780 Info AppManagerStates.cpp:1802: Saving finished",
|
"4202.780 Info AppManagerStates.cpp:1802: Saving finished",
|
||||||
@@ -141,7 +141,7 @@ let testLines = new Map([
|
|||||||
level: "Info",
|
level: "Info",
|
||||||
file: "AppManagerStates.cpp:1802",
|
file: "AppManagerStates.cpp:1802",
|
||||||
message: "Saving finished",
|
message: "Saving finished",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -523,7 +523,7 @@ describe("lib/prometheus", function() {
|
|||||||
|
|
||||||
let serializedResult = {
|
let serializedResult = {
|
||||||
metric: { type: "type", name: "name", help: "Help", labels: ["a", "b"] },
|
metric: { type: "type", name: "name", help: "Help", labels: ["a", "b"] },
|
||||||
samples: [ ['a="1",b="2"', 1], ['a="3",b="4"', 5], ]
|
samples: [ ['a="1",b="2"', 1], ['a="3",b="4"', 5] ],
|
||||||
};
|
};
|
||||||
let deserializedResult = {
|
let deserializedResult = {
|
||||||
metric: new prometheus.Metric("type", "name", "Help", ["a", "b"]),
|
metric: new prometheus.Metric("type", "name", "Help", ["a", "b"]),
|
||||||
@@ -563,7 +563,7 @@ describe("lib/prometheus", function() {
|
|||||||
prometheus.serializeResult({
|
prometheus.serializeResult({
|
||||||
metric: new prometheus.Metric("type", "name", "Help"),
|
metric: new prometheus.Metric("type", "name", "Help"),
|
||||||
samples: new Map([["", 2]]),
|
samples: new Map([["", 2]]),
|
||||||
}, { metricName: "new", }),
|
}, { metricName: "new" }),
|
||||||
{
|
{
|
||||||
metric: { type: "type", name: "new", help: "Help", labels: [] },
|
metric: { type: "type", name: "new", help: "Help", labels: [] },
|
||||||
samples: [["", 2]],
|
samples: [["", 2]],
|
||||||
@@ -573,7 +573,7 @@ describe("lib/prometheus", function() {
|
|||||||
prometheus.serializeResult({
|
prometheus.serializeResult({
|
||||||
metric: new prometheus.Metric("type", "name", "Help"),
|
metric: new prometheus.Metric("type", "name", "Help"),
|
||||||
samples: new Map([["", 2]]),
|
samples: new Map([["", 2]]),
|
||||||
}, { metricHelp: "old", }),
|
}, { metricHelp: "old" }),
|
||||||
{
|
{
|
||||||
metric: { type: "type", name: "name", help: "old", labels: [] },
|
metric: { type: "type", name: "name", help: "old", labels: [] },
|
||||||
samples: [["", 2]],
|
samples: [["", 2]],
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ class MockInstance extends link.Link {
|
|||||||
get: (name) => {
|
get: (name) => {
|
||||||
if (name === "instance.id") { return 7357; }
|
if (name === "instance.id") { return 7357; }
|
||||||
throw Error("Not implemented");
|
throw Error("Not implemented");
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user