Removed the word "matcher" from the pkty matcher functions

If we want them back we can always undo this commit and convert the other custom ones
This commit is contained in:
Bertie690 2025-07-27 21:19:55 -04:00
parent 83392d7e86
commit 82fc39b2e5
13 changed files with 36 additions and 36 deletions

View File

@ -8,7 +8,7 @@ import type { StatusEffect } from "#enums/status-effect";
import type { WeatherType } from "#enums/weather-type";
import type { Pokemon } from "#field/pokemon";
import type { ToHaveEffectiveStatMatcherOptions } from "#test/test-utils/matchers/to-have-effective-stat";
import { expectedStatusType } from "#test/test-utils/matchers/to-have-status-effect-matcher";
import { expectedStatusType } from "#test/test-utils/matchers/to-have-status-effect";
import type { toHaveTypesOptions } from "#test/test-utils/matchers/to-have-types";
import { TurnMove } from "#types/turn-move";
import { AtLeastOne } from "#types/type-helpers";

View File

@ -1,17 +1,17 @@
import { toEqualArrayUnsorted } from "#test/test-utils/matchers/to-equal-array-unsorted";
import { toHaveAbilityAppliedMatcher } from "#test/test-utils/matchers/to-have-ability-applied";
import { toHaveAbilityApplied } from "#test/test-utils/matchers/to-have-ability-applied";
import { toHaveBattlerTag } from "#test/test-utils/matchers/to-have-battler-tag";
import { toHaveEffectiveStatMatcher } from "#test/test-utils/matchers/to-have-effective-stat";
import { toHaveFaintedMatcher } from "#test/test-utils/matchers/to-have-fainted";
import { toHaveFullHpMatcher } from "#test/test-utils/matchers/to-have-full-hp";
import { toHaveHpMatcher } from "#test/test-utils/matchers/to-have-hp";
import { toHaveStatStageMatcher } from "#test/test-utils/matchers/to-have-stat-stage-matcher";
import { toHaveStatusEffectMatcher } from "#test/test-utils/matchers/to-have-status-effect-matcher";
import { toHaveTakenDamageMatcher } from "#test/test-utils/matchers/to-have-taken-damage-matcher";
import { toHaveTerrainMatcher } from "#test/test-utils/matchers/to-have-terrain-matcher";
import { toHaveEffectiveStat } from "#test/test-utils/matchers/to-have-effective-stat";
import { toHaveFainted } from "#test/test-utils/matchers/to-have-fainted";
import { toHaveFullHp } from "#test/test-utils/matchers/to-have-full-hp";
import { toHaveHp } from "#test/test-utils/matchers/to-have-hp";
import { toHaveStatStage } from "#test/test-utils/matchers/to-have-stat-stage";
import { toHaveStatusEffect } from "#test/test-utils/matchers/to-have-status-effect";
import { toHaveTakenDamage } from "#test/test-utils/matchers/to-have-taken-damage";
import { toHaveTerrain } from "#test/test-utils/matchers/to-have-terrain";
import { toHaveTypes } from "#test/test-utils/matchers/to-have-types";
import { toHaveUsedMoveMatcher } from "#test/test-utils/matchers/to-have-used-move-matcher";
import { toHaveWeatherMatcher } from "#test/test-utils/matchers/to-have-weather-matcher";
import { toHaveUsedMove } from "#test/test-utils/matchers/to-have-used-move";
import { toHaveWeather } from "#test/test-utils/matchers/to-have-weather";
import { expect } from "vitest";
/*
@ -22,16 +22,16 @@ import { expect } from "vitest";
expect.extend({
toEqualArrayUnsorted,
toHaveTypes,
toHaveUsedMove: toHaveUsedMoveMatcher,
toHaveEffectiveStat: toHaveEffectiveStatMatcher,
toHaveTakenDamage: toHaveTakenDamageMatcher,
toHaveWeather: toHaveWeatherMatcher,
toHaveTerrain: toHaveTerrainMatcher,
toHaveFullHp: toHaveFullHpMatcher,
toHaveStatusEffect: toHaveStatusEffectMatcher,
toHaveStatStage: toHaveStatStageMatcher,
toHaveBattlerTag: toHaveBattlerTag,
toHaveAbilityApplied: toHaveAbilityAppliedMatcher,
toHaveHp: toHaveHpMatcher,
toHaveFainted: toHaveFaintedMatcher,
toHaveUsedMove,
toHaveEffectiveStat,
toHaveTakenDamage,
toHaveWeather,
toHaveTerrain,
toHaveFullHp,
toHaveStatusEffect,
toHaveStatStage,
toHaveBattlerTag,
toHaveAbilityApplied,
toHaveHp,
toHaveFainted,
});

View File

@ -9,12 +9,12 @@ import { isPokemonInstance, receivedStr } from "#test/test-utils/test-utils";
import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
/**
* Matcher to check if a {@linkcode Pokemon} had a specific {@linkcode AbilityId} applied.
* Matcher to check if a {@linkcode Pokemon} has applied a specific {@linkcode AbilityId}.
* @param received - The object to check. Should be a {@linkcode Pokemon}
* @param expectedAbility - The {@linkcode AbilityId} to check for
* @returns Whether the matcher passed
*/
export function toHaveAbilityAppliedMatcher(
export function toHaveAbilityApplied(
this: MatcherState,
received: unknown,
expectedAbilityId: AbilityId,

View File

@ -33,7 +33,7 @@ export interface ToHaveEffectiveStatMatcherOptions {
* @param options - The {@linkcode ToHaveEffectiveStatMatcherOptions}
* @returns Whether the matcher passed
*/
export function toHaveEffectiveStatMatcher(
export function toHaveEffectiveStat(
this: MatcherState,
received: unknown,
stat: EffectiveStat,

View File

@ -7,7 +7,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* @param received - The object to check. Should be a {@linkcode Pokemon}
* @returns Whether the matcher passed
*/
export function toHaveFaintedMatcher(this: MatcherState, received: unknown): SyncExpectationResult {
export function toHaveFainted(this: MatcherState, received: unknown): SyncExpectationResult {
if (!isPokemonInstance(received)) {
return {
pass: false,

View File

@ -7,7 +7,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* @param received - The object to check. Should be a {@linkcode Pokemon}.
* @returns Whether the matcher passed
*/
export function toHaveFullHpMatcher(this: MatcherState, received: unknown): SyncExpectationResult {
export function toHaveFullHp(this: MatcherState, received: unknown): SyncExpectationResult {
if (!isPokemonInstance(received)) {
return {
pass: false,

View File

@ -10,7 +10,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* @param expectedHp - The expected amount of HP the {@linkcode Pokemon} has
* @returns Whether the matcher passed
*/
export function toHaveHpMatcher(this: MatcherState, received: unknown, expectedHp: number): SyncExpectationResult {
export function toHaveHp(this: MatcherState, received: unknown, expectedHp: number): SyncExpectationResult {
if (!isPokemonInstance(received)) {
return {
pass: false,

View File

@ -11,7 +11,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* @param expectedStage - The expected numerical value of {@linkcode stat}; should be within the range `[-6, 6]`
* @returns Whether the matcher passed
*/
export function toHaveStatStageMatcher(
export function toHaveStatStage(
this: MatcherState,
received: unknown,
stat: BattleStat,

View File

@ -20,7 +20,7 @@ export type expectedStatusType =
* or a partially filled {@linkcode Status} containing the desired properties
* @returns Whether the matcher passed
*/
export function toHaveStatusEffectMatcher(
export function toHaveStatusEffect(
this: MatcherState,
received: unknown,
expectedStatus: expectedStatusType,

View File

@ -12,7 +12,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* @param roundDown - Whether to round down {@linkcode expectedDamageTaken} with {@linkcode toDmgValue}; default `true`
* @returns Whether the matcher passed
*/
export function toHaveTakenDamageMatcher(
export function toHaveTakenDamage(
this: MatcherState,
received: unknown,
expectedDamageTaken: number,

View File

@ -9,7 +9,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* @param expectedTerrainType - The expected {@linkcode TerrainType}, or {@linkcode TerrainType.NONE} if no terrain should be active
* @returns Whether the matcher passed
*/
export function toHaveTerrainMatcher(
export function toHaveTerrain(
this: MatcherState,
received: unknown,
expectedTerrainType: TerrainType,

View File

@ -17,7 +17,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* Default `0` (last used move)
* @returns Whether the matcher passed
*/
export function toHaveUsedMoveMatcher(
export function toHaveUsedMove(
this: MatcherState,
received: unknown,
expectedResult: MoveId | AtLeastOne<TurnMove>,

View File

@ -9,7 +9,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
* @param expectedWeatherType - The expected {@linkcode WeatherType}
* @returns Whether the matcher passed
*/
export function toHaveWeatherMatcher(
export function toHaveWeather(
this: MatcherState,
received: unknown,
expectedWeatherType: WeatherType,