Use strict equality checking

Remove usage of == and != in favour of === and !==.
This commit is contained in:
Hornwitser committed 2020-10-23 19:05:12 +02:00
1 parent ee81fbb7f6
commit a84f2d5eb6
13 files changed
+29 -21

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ async function get(path) {
url: `https://localhost:4443${path}`,
core: { rejectUnauthorized: false },
});
if (res.statusCode != 200) {
if (res.statusCode !== 200) {
throw new Error(`Got response code ${res.statusCode}, content: ${res.body}`);
}
return res;
+1 -1
View File
@@ -204,7 +204,7 @@ describe("Integration of lib/factorio/server", function() {
describe(".start() termination detection", function() {
it("should tell if Factorio got killed", async function() {
// This does not work on Windows
if (process.platform == "win32") {
if (process.platform === "win32") {
this.skip();
}
slowTest(this);
+7 -7
View File
@@ -87,7 +87,7 @@ describe("lib/prometheus", function() {
prometheus.defaultRegistry.unregister(collector);
}
assert(
prometheus.defaultRegistry.collectors.length == 0,
prometheus.defaultRegistry.collectors.length === 0,
"Collectors left over after removing the default ones"
);
});
@@ -367,7 +367,7 @@ describe("lib/prometheus", function() {
gauge.labels({ a: "3", b: "4" });
gauge.labels({ a: "5", b: "6" });
gauge.clear();
assert(gauge._values.size == 0, "values was not cleared");
assert(gauge._values.size === 0, "values was not cleared");
});
it("should throw when used on an unlabled metric", function() {
let gauge = new prometheus.Gauge("test", "Help", { register: false });
@@ -389,7 +389,7 @@ describe("lib/prometheus", function() {
}
assert(
results.length == 1,
results.length === 1,
"collector did not give exactly one result"
);
@@ -409,7 +409,7 @@ describe("lib/prometheus", function() {
}
assert(
results.length == 1,
results.length === 1,
"collector did not give exactly one result"
);
@@ -430,7 +430,7 @@ describe("lib/prometheus", function() {
}
assert(
results.length == 1,
results.length === 1,
"collector did not give exactly one result"
);
@@ -451,7 +451,7 @@ describe("lib/prometheus", function() {
}
assert(
results.length == 1,
results.length === 1,
"collector did not give exactly one result"
);
@@ -604,7 +604,7 @@ describe("lib/prometheus", function() {
it("should not have any collectors in the default registry", function() {
this.skip(); // XXX Doesn't work in Clusterio's shared testing env
assert(
prometheus.defaultRegistry.collectors.length == 0,
prometheus.defaultRegistry.collectors.length === 0,
"Collectors left over by test code"
);
});
+1 -1
View File
@@ -140,7 +140,7 @@ describe("Slave testing", function() {
it("should unlink removed mods", async function() {
// This does not work on Windows
if (process.platform == "win32") {
if (process.platform === "win32") {
this.skip();
}