From 57b8b466df7c2eb75a250e248f5d50a77aca5b01 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Thu, 14 Aug 2025 21:30:08 -0400 Subject: [PATCH] fixed issues with declare vs override oopsie --- src/data/positional-tags/positional-tag.ts | 8 +++++--- test/moves/heal-block.test.ts | 6 ++---- test/test-utils/matchers/to-have-positional-tag.ts | 6 ++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/data/positional-tags/positional-tag.ts b/src/data/positional-tags/positional-tag.ts index 9f3af265c26..62d7fe3031f 100644 --- a/src/data/positional-tags/positional-tag.ts +++ b/src/data/positional-tags/positional-tag.ts @@ -2,12 +2,14 @@ import { globalScene } from "#app/global-scene"; import { getPokemonNameWithAffix } from "#app/messages"; // biome-ignore-start lint/correctness/noUnusedImports: TSDoc import type { ArenaTag } from "#data/arena-tag"; +import type { Stat } from "#enums/stat"; // biome-ignore-end lint/correctness/noUnusedImports: TSDoc + import { allMoves } from "#data/data-lists"; import type { BattlerIndex } from "#enums/battler-index"; import type { MoveId } from "#enums/move-id"; import { MoveUseMode } from "#enums/move-use-mode"; -import type { PositionalTagType } from "#enums/positional-tag-type"; +import { PositionalTagType } from "#enums/positional-tag-type"; import type { Pokemon } from "#field/pokemon"; import i18next from "i18next"; @@ -87,7 +89,7 @@ interface DelayedAttackArgs extends PositionalTagBaseArgs { * triggering against a certain slot after the turn count has elapsed. */ export class DelayedAttackTag extends PositionalTag implements DelayedAttackArgs { - public declare readonly tagType: PositionalTagType.DELAYED_ATTACK; + public override readonly tagType = PositionalTagType.DELAYED_ATTACK; public readonly sourceMove: MoveId; public readonly sourceId: number; @@ -142,7 +144,7 @@ interface WishArgs extends PositionalTagBaseArgs { * Tag to implement {@linkcode MoveId.WISH | Wish}. */ export class WishTag extends PositionalTag implements WishArgs { - public declare readonly tagType: PositionalTagType.WISH; + public override readonly tagType = PositionalTagType.WISH; public readonly pokemonName: string; public readonly healHp: number; diff --git a/test/moves/heal-block.test.ts b/test/moves/heal-block.test.ts index 4c8e6395171..613c57f05a7 100644 --- a/test/moves/heal-block.test.ts +++ b/test/moves/heal-block.test.ts @@ -77,15 +77,13 @@ describe("Moves - Heal Block", () => { game.move.use(MoveId.WISH); await game.toNextTurn(); - expect(game.scene.arena.positionalTagManager.tags.filter(t => t.tagType === PositionalTagType.WISH)) // - .toHaveLength(1); + expect(game).toHavePositionalTag(PositionalTagType.WISH); game.move.use(MoveId.SPLASH); await game.toNextTurn(); // wish triggered, but did NOT heal the player - expect(game.scene.arena.positionalTagManager.tags.filter(t => t.tagType === PositionalTagType.WISH)) // - .toHaveLength(0); + expect(game).toHavePositionalTag(PositionalTagType.WISH, 0); expect(player.hp).toBe(1); }); diff --git a/test/test-utils/matchers/to-have-positional-tag.ts b/test/test-utils/matchers/to-have-positional-tag.ts index 448339d6a8d..f100354023d 100644 --- a/test/test-utils/matchers/to-have-positional-tag.ts +++ b/test/test-utils/matchers/to-have-positional-tag.ts @@ -1,4 +1,6 @@ // biome-ignore-start lint/correctness/noUnusedImports: TSDoc + +import type { PositionalTag } from "#data/positional-tags/positional-tag"; import type { GameManager } from "#test/test-utils/game-manager"; // biome-ignore-end lint/correctness/noUnusedImports: TSDoc @@ -17,8 +19,8 @@ export type toHavePositionalTagOptions

= OneOther