From f52faab436bc4dda39b662b4669de0de8c129a9e Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Mon, 15 Sep 2025 20:49:13 -0400 Subject: [PATCH] Renamed `toEqualArrayUnsorted` into `toEqualUnsorted` --- test/@types/vitest.d.ts | 2 +- test/setup/matchers.setup.ts | 4 ++-- .../{to-equal-array-unsorted.ts => to-equal-unsorted.ts} | 6 +----- 3 files changed, 4 insertions(+), 8 deletions(-) rename test/test-utils/matchers/{to-equal-array-unsorted.ts => to-equal-unsorted.ts} (92%) diff --git a/test/@types/vitest.d.ts b/test/@types/vitest.d.ts index 3d9fce78e98..bf3f87a1db6 100644 --- a/test/@types/vitest.d.ts +++ b/test/@types/vitest.d.ts @@ -63,7 +63,7 @@ interface GenericMatchers { * @param expected - The expected contents of the array, in any order * @see {@linkcode expect.arrayContaining} */ - toEqualArrayUnsorted: T extends (infer U)[] ? (expected: U[]) => void : never; + toEqualUnsorted: T extends (infer U)[] ? (expected: U[]) => void : never; /** * Check whether a {@linkcode Map} contains the given key, disregarding its value. diff --git a/test/setup/matchers.setup.ts b/test/setup/matchers.setup.ts index baa32a6777f..bead180f6f3 100644 --- a/test/setup/matchers.setup.ts +++ b/test/setup/matchers.setup.ts @@ -1,5 +1,5 @@ import { toBeAtPhase } from "#test/test-utils/matchers/to-be-at-phase"; -import { toEqualArrayUnsorted } from "#test/test-utils/matchers/to-equal-array-unsorted"; +import { toEqualUnsorted } from "#test/test-utils/matchers/to-equal-unsorted"; import { toHaveAbilityApplied } from "#test/test-utils/matchers/to-have-ability-applied"; import { toHaveArenaTag } from "#test/test-utils/matchers/to-have-arena-tag"; import { toHaveBattlerTag } from "#test/test-utils/matchers/to-have-battler-tag"; @@ -27,7 +27,7 @@ import { expect } from "vitest"; */ expect.extend({ - toEqualArrayUnsorted, + toEqualUnsorted, toHaveKey, toHaveShownMessage, toBeAtPhase, diff --git a/test/test-utils/matchers/to-equal-array-unsorted.ts b/test/test-utils/matchers/to-equal-unsorted.ts similarity index 92% rename from test/test-utils/matchers/to-equal-array-unsorted.ts rename to test/test-utils/matchers/to-equal-unsorted.ts index 97398689032..c3d85288815 100644 --- a/test/test-utils/matchers/to-equal-array-unsorted.ts +++ b/test/test-utils/matchers/to-equal-unsorted.ts @@ -8,11 +8,7 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect"; * @param expected - The array to check equality with * @returns Whether the matcher passed */ -export function toEqualArrayUnsorted( - this: MatcherState, - received: unknown, - expected: unknown[], -): SyncExpectationResult { +export function toEqualUnsorted(this: MatcherState, received: unknown, expected: unknown[]): SyncExpectationResult { if (!Array.isArray(received)) { return { pass: this.isNot,