mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-28 05:49:47 +00:00
Enable the no-undef eslint rule (#1848)
## Description: Enable the `no-undef` eslint rule. Fixes #1786 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced
This commit is contained in:
@@ -91,7 +91,7 @@ describe("MissileSilo", () => {
|
||||
});
|
||||
|
||||
test("missilesilo should have increased level after upgrade", async () => {
|
||||
expect(attacker.units(UnitType.MissileSilo)[0].level()).toEqual(1);
|
||||
expect(attacker.units(UnitType.MissileSilo)[0].level()).toBe(1);
|
||||
|
||||
const upgradeStructureExecution = new UpgradeStructureExecution(
|
||||
attacker,
|
||||
@@ -100,6 +100,6 @@ describe("MissileSilo", () => {
|
||||
game.addExecution(upgradeStructureExecution);
|
||||
executeTicks(game, 2);
|
||||
|
||||
expect(attacker.units(UnitType.MissileSilo)[0].level()).toEqual(2);
|
||||
expect(attacker.units(UnitType.MissileSilo)[0].level()).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -96,7 +96,7 @@ describe("PlayerImpl", () => {
|
||||
|
||||
const ports = player.tradingPorts(playerPort);
|
||||
|
||||
expect(ports.length).toBe(3);
|
||||
expect(ports).toHaveLength(3);
|
||||
});
|
||||
|
||||
test("Can't send alliance requests when dead", () => {
|
||||
|
||||
@@ -83,7 +83,7 @@ describe("assignTeams", () => {
|
||||
expect(result.get(players[1])).toEqual(ColoredTeams.Red);
|
||||
expect(result.get(players[2])).toEqual(ColoredTeams.Red);
|
||||
|
||||
expect(result.get(players[3])).toEqual("kicked");
|
||||
expect(result.get(players[3])).toBe("kicked");
|
||||
|
||||
expect(result.get(players[4])).toEqual(ColoredTeams.Blue);
|
||||
expect(result.get(players[5])).toEqual(ColoredTeams.Blue);
|
||||
@@ -151,7 +151,7 @@ describe("assignTeams", () => {
|
||||
|
||||
expect(result.get(players[0])).toEqual(ColoredTeams.Red);
|
||||
expect(result.get(players[1])).toEqual(ColoredTeams.Red);
|
||||
expect(result.get(players[2])).toEqual("kicked");
|
||||
expect(result.get(players[2])).toBe("kicked");
|
||||
expect(result.get(players[3])).toEqual(ColoredTeams.Blue);
|
||||
expect(result.get(players[4])).toEqual(ColoredTeams.Blue);
|
||||
expect(result.get(players[5])).toEqual(ColoredTeams.Yellow);
|
||||
|
||||
@@ -90,7 +90,7 @@ describe("Unit Grid range tests", () => {
|
||||
range,
|
||||
units, // remove readonly
|
||||
);
|
||||
expect(result.length).toBe(expectedResult);
|
||||
expect(result).toHaveLength(expectedResult);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ describe("SAM", () => {
|
||||
|
||||
test("SAM should have increased level after upgrade", async () => {
|
||||
defender.buildUnit(UnitType.SAMLauncher, game.ref(1, 1), {});
|
||||
expect(defender.units(UnitType.SAMLauncher)[0].level()).toEqual(1);
|
||||
expect(defender.units(UnitType.SAMLauncher)[0].level()).toBe(1);
|
||||
|
||||
const upgradeStructureExecution = new UpgradeStructureExecution(
|
||||
defender,
|
||||
@@ -239,6 +239,6 @@ describe("SAM", () => {
|
||||
game.addExecution(upgradeStructureExecution);
|
||||
executeTicks(game, 2);
|
||||
|
||||
expect(defender.units(UnitType.SAMLauncher)[0].level()).toEqual(2);
|
||||
expect(defender.units(UnitType.SAMLauncher)[0].level()).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ describe("StationManagerImpl", () => {
|
||||
const station = createMockStation(1);
|
||||
manager.addStation(station);
|
||||
manager.removeStation(station);
|
||||
expect(manager.findStation(station.unit)).toBe(null);
|
||||
expect(manager.findStation(station.unit)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user