Compare commits

...

5 Commits

Author SHA1 Message Date
Bertie690
6866248b41
Update test/test-utils/matchers/to-have-positional-tag.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-05 00:05:04 -04:00
Bertie690
9298ff8282
Update test/test-utils/matchers/to-have-positional-tag.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-05 00:04:55 -04:00
Bertie690
7e7ca6b3fa
Update test/test-utils/matchers/to-have-positional-tag.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-05 00:04:39 -04:00
Bertie690
cd890025d1
Update test/@types/vitest.d.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-05 00:04:31 -04:00
Bertie690
71801fe298
Update test/test-utils/matchers/to-have-types.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-05 00:04:20 -04:00
3 changed files with 7 additions and 7 deletions

View File

@ -133,7 +133,7 @@ declare module "vitest" {
/** /**
* Check whether a {@linkcode Pokemon} has applied a specific {@linkcode AbilityId}. * Check whether a {@linkcode Pokemon} has applied a specific {@linkcode AbilityId}.
* @param expectedAbilityId - The expected {@linkcode AbilityId} to * @param expectedAbilityId - The expected {@linkcode AbilityId} to check for
*/ */
toHaveAbilityApplied(expectedAbilityId: AbilityId): void; toHaveAbilityApplied(expectedAbilityId: AbilityId): void;

View File

@ -1,9 +1,10 @@
import type { SerializedPositionalTag, serializedPosTagMap } from "#data/positional-tags/load-positional-tag";
import type { PositionalTagType } from "#enums/positional-tag-type";
import type { OneOther } from "#test/@types/test-helpers";
// biome-ignore-start lint/correctness/noUnusedImports: TSDoc // biome-ignore-start lint/correctness/noUnusedImports: TSDoc
import type { GameManager } from "#test/test-utils/game-manager"; import type { GameManager } from "#test/test-utils/game-manager";
// biome-ignore-end lint/correctness/noUnusedImports: TSDoc // biome-ignore-end lint/correctness/noUnusedImports: TSDoc
import type { SerializedPositionalTag, serializedPosTagMap } from "#data/positional-tags/load-positional-tag";
import type { PositionalTagType } from "#enums/positional-tag-type";
import type { OneOther } from "#test/@types/test-helpers";
import { getOnelineDiffStr } from "#test/test-utils/string-utils"; import { getOnelineDiffStr } from "#test/test-utils/string-utils";
import { isGameManagerInstance, receivedStr } from "#test/test-utils/test-utils"; import { isGameManagerInstance, receivedStr } from "#test/test-utils/test-utils";
import { toTitleCase } from "#utils/strings"; import { toTitleCase } from "#utils/strings";
@ -55,7 +56,7 @@ export function toHavePositionalTag<P extends PositionalTagType>(
const tagType = typeof expectedTag === "string" ? expectedTag : expectedTag.tagType; const tagType = typeof expectedTag === "string" ? expectedTag : expectedTag.tagType;
const matchingTags = allTags.filter(t => t.tagType === tagType); const matchingTags = allTags.filter(t => t.tagType === tagType);
// If checking exclusively tag type, check solely the number of ,atching tags on field // If checking exclusively tag type, check solely the number of matching tags on field
if (typeof expectedTag === "string") { if (typeof expectedTag === "string") {
const pass = matchingTags.length === count; const pass = matchingTags.length === count;
const expectedStr = getPosTagStr(expectedTag); const expectedStr = getPosTagStr(expectedTag);
@ -72,7 +73,6 @@ export function toHavePositionalTag<P extends PositionalTagType>(
} }
// Check for equality with the provided object // Check for equality with the provided object
if (matchingTags.length === 0) { if (matchingTags.length === 0) {
return { return {
pass: false, pass: false,

View File

@ -47,7 +47,7 @@ export function toHaveTypes(
if (expectedTypes.length === 0) { if (expectedTypes.length === 0) {
return { return {
pass: this.isNot, pass: this.isNot,
message: () => "Expected to recieve a non-empty array of PokemonTypes, but got one!", message: () => "Expected to receive a non-empty array of PokemonTypes!",
}; };
} }