mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 08:45:04 +00:00
Enable the prefer-destructuring eslint rule (#1858)
## Description: Enable the `prefer-destructuring` eslint rule. ## 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:
@@ -79,7 +79,7 @@ describe("InputHandler AutoUpgrade", () => {
|
||||
}),
|
||||
);
|
||||
|
||||
const calls = mockEmit.mock.calls;
|
||||
const { calls } = mockEmit.mock;
|
||||
const lastCall = calls[calls.length - 1];
|
||||
expect(lastCall[0]).not.toBeInstanceOf(AutoUpgradeEvent);
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ describe("Warship", () => {
|
||||
});
|
||||
|
||||
test("Warship heals only if player has port", async () => {
|
||||
const maxHealth = game.config().unitInfo(UnitType.Warship).maxHealth;
|
||||
const { maxHealth } = game.config().unitInfo(UnitType.Warship);
|
||||
if (typeof maxHealth !== "number") {
|
||||
expect(typeof maxHealth).toBe("number");
|
||||
throw new Error("unreachable");
|
||||
|
||||
Reference in New Issue
Block a user