mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-14 11:29:28 +02:00
Compare commits
5 Commits
e968063eaa
...
6866248b41
Author | SHA1 | Date | |
---|---|---|---|
|
6866248b41 | ||
|
9298ff8282 | ||
|
7e7ca6b3fa | ||
|
cd890025d1 | ||
|
71801fe298 |
2
test/@types/vitest.d.ts
vendored
2
test/@types/vitest.d.ts
vendored
@ -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;
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -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!",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user