Fix capitalization of constructors

Enforce new-cap rule and fix capitalization and mistakes related to
constructors.
This commit is contained in:
Hornwitser committed 2020-10-23 21:22:45 +02:00
1 parent 00a1f6aea7
commit 8586dfb95f
10 files changed
+25 -25

No files matched your search

+3 -3
View File
@@ -1,7 +1,7 @@
"use strict";
const assert = require("assert").strict;
const fs = require("fs-extra");
const jszip = require("jszip");
const JSZip = require("jszip");
const path = require("path");
const libFactorio = require("@clusterio/lib/factorio");
@@ -33,14 +33,14 @@ describe("Integration of lib/factorio/patch", function() {
require: [],
}]);
let zip = await jszip.loadAsync(await fs.readFile(savePath));
let zip = await JSZip.loadAsync(await fs.readFile(savePath));
assert.equal(await zip.file("test/modules/test/test.lua").async("string"), "-- test\n");
assert.equal(await zip.file("test/modules/subdir/dir/test.lua").async("string"), "-- test\n");
});
it("should remove old modules in a save", async function() {
slowTest(this);
await libFactorio.patch(savePath, []);
let zip = await jszip.loadAsync(await fs.readFile(savePath));
let zip = await JSZip.loadAsync(await fs.readFile(savePath));
assert.equal(zip.file("test/modules/test/test.lua"), null);
});
});
+6 -6
View File
@@ -1,7 +1,7 @@
"use strict";
const assert = require("assert").strict;
const fs = require("fs-extra");
const jszip = require("jszip");
const JSZip = require("jszip");
const path = require("path");
const libFactorio = require("@clusterio/lib/factorio");
@@ -10,7 +10,7 @@ const libFactorio = require("@clusterio/lib/factorio");
describe("lib/factorio", function() {
describe("findRoot()", function() {
it("should find the root of a zip", function() {
let zip = new jszip();
let zip = new JSZip();
zip.file("root/foo.txt", "");
zip.file("root/bar.txt", "");
@@ -18,7 +18,7 @@ describe("lib/factorio", function() {
});
it("should throw if files are at the root of the zip", function() {
let zip = new jszip();
let zip = new JSZip();
zip.file("root/foo.txt", "");
zip.file("bar.txt", "");
@@ -29,7 +29,7 @@ describe("lib/factorio", function() {
});
it("should throw if there are multiple root dirs", function() {
let zip = new jszip();
let zip = new JSZip();
zip.file("root-1/foo.txt", "");
zip.file("root-2/bar.txt", "");
@@ -40,7 +40,7 @@ describe("lib/factorio", function() {
});
it("should throw if given an empty zip file", function() {
let zip = new jszip();
let zip = new JSZip();
assert.throws(
() => libFactorio._findRoot(zip),
@@ -211,7 +211,7 @@ describe("lib/factorio", function() {
describe("patch()", function() {
it("should throw on unknown scenario", async function() {
let zip = new jszip();
let zip = new JSZip();
zip.file("world/control.lua", "-- unknown\n");
let zipPath = path.join("temp", "test", "patch.zip");
await fs.outputFile(zipPath, await zip.generateAsync({ type: "nodebuffer" }));
+1 -1
View File
@@ -582,7 +582,7 @@ describe("lib/prometheus", function() {
});
it("should throw on unrecoginzed option", function() {
assert.throws(
() => new prometheus.serializeResult({
() => prometheus.serializeResult({
metric: new prometheus.Metric("type", "name", "Help"),
samples: new Map([["", 3]]),
}, { invalid: true }),