pokerogue/test/@types/vitest.d.ts
Bertie690 f3854abc16
[Test] Added custom equality matchers (#6157)
* Added rudimentary test matchers for `toEqualArrayUnsorted` and `toHaveTypes`

Might port the rest at a later date

* Actually run the effing setup matchers file + fixed ls lint to not be angy

* added dev dep

* Update .ls-lint.yml

* Update .ls-lint.yml

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
2025-07-27 20:16:04 +00:00

26 lines
1013 B
TypeScript

import type { Pokemon } from "#field/pokemon";
import type { PokemonType } from "#enums/pokemon-type";
import type { expect } from "vitest";
import { toHaveTypesOptions } from "#test/test-utils/matchers/to-have-types";
declare module "vitest" {
interface Assertion {
/**
* Matcher to check if an array contains EXACTLY the given items (in any order).
*
* Different from {@linkcode expect.arrayContaining} as the latter only requires the array contain
* _at least_ the listed items.
*
* @param expected - The expected contents of the array, in any order.
* @see {@linkcode expect.arrayContaining}
*/
toEqualArrayUnsorted<E>(expected: E[]): void;
/**
* Matcher to check if a {@linkcode Pokemon}'s current typing includes the given types.
*
* @param expected - The expected types (in any order).
* @param options - The options passed to the matcher.
*/
toHaveTypes(expected: PokemonType[], options?: toHaveTypesOptions): void;
}
}