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

+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" }));