mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-15 03:49:33 +02:00
ddd
This commit is contained in:
parent
3a6026d637
commit
6c54695a73
@ -19,7 +19,6 @@
|
||||
// and having to verify whether each individual file is ignored
|
||||
"includes": [
|
||||
"**",
|
||||
"!**/*.d.ts",
|
||||
"!**/dist/**/*",
|
||||
"!**/build/**/*",
|
||||
"!**/coverage/**/*",
|
||||
@ -179,7 +178,7 @@
|
||||
|
||||
// Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes)
|
||||
{
|
||||
"includes": ["**/src/overrides.ts", "**/src/enums/**/*"],
|
||||
"includes": ["**/src/overrides.ts", "**/src/enums/**/*", "**/*.d.ts"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
|
14
test/@types/vitest.d.ts
vendored
14
test/@types/vitest.d.ts
vendored
@ -1,17 +1,17 @@
|
||||
import type { Pokemon } from "#field/pokemon";
|
||||
import type { PokemonType } from "#enums/pokemon-type";
|
||||
import type { expect } from "vitest";
|
||||
import type { toHaveTypesOptions } from "#test/test-utils/matchers/to-have-types";
|
||||
import type { TerrainType } from "#app/data/terrain";
|
||||
import type { AbilityId } from "#enums/ability-id";
|
||||
import type { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import type { MoveId } from "#enums/move-id";
|
||||
import type { PokemonType } from "#enums/pokemon-type";
|
||||
import type { BattleStat, EffectiveStat, Stat } from "#enums/stat";
|
||||
import type { StatusEffect } from "#enums/status-effect";
|
||||
import type { TerrainType } from "#app/data/terrain";
|
||||
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 { TurnMove } from "#types/turn-move";
|
||||
import { expectedStatusType } from "#test/test-utils/matchers/to-have-status-effect-matcher";
|
||||
import type { toHaveTypesOptions } from "#test/test-utils/matchers/to-have-types";
|
||||
import { TurnMove } from "#types/turn-move";
|
||||
import type { expect } from "vitest";
|
||||
|
||||
declare module "vitest" {
|
||||
interface Assertion {
|
||||
@ -117,4 +117,4 @@ declare module "vitest" {
|
||||
*/
|
||||
toHaveFainted(): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
|
||||
|
||||
/**
|
||||
* Matcher to check if a {@linkcode Pokemon} had a specific {@linkcode AbilityId} applied.
|
||||
* @param received - The object to check. Should be a {@linkcode Pokemon}.
|
||||
* @param expectedAbility - The {@linkcode AbilityId} to check for.
|
||||
* @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(
|
||||
|
@ -47,6 +47,7 @@ export function toHaveEffectiveStatMatcher(
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: Change once getEffectiveStat is refactored to take an object literal
|
||||
const actualValue = received.getEffectiveStat(stat, enemy, move, undefined, undefined, undefined, isCritical);
|
||||
const pass = actualValue === expectedValue;
|
||||
|
||||
|
@ -3,8 +3,8 @@ import { isPokemonInstance, receivedStr } from "#test/test-utils/test-utils";
|
||||
import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
|
||||
|
||||
/**
|
||||
* Matcher to check if a Pokemon has fainted
|
||||
* @param received - The object to check. Should be a {@linkcode Pokemon}.
|
||||
* Matcher to check if a Pokemon has fainted.
|
||||
* @param received - The object to check. Should be a {@linkcode Pokemon}
|
||||
* @returns Whether the matcher passed
|
||||
*/
|
||||
export function toHaveFaintedMatcher(this: MatcherState, received: unknown): SyncExpectationResult {
|
||||
|
@ -41,7 +41,7 @@ export function toHaveStatStageMatcher(
|
||||
message: () =>
|
||||
pass
|
||||
? `Expected ${pkmName}'s ${statName} stat stage to NOT be ${expectedStage}, but it was!`
|
||||
: `Expected ${pkmName}'s ${statName} stage to be ${expectedStage}, but got ${actualStage}!`,
|
||||
: `Expected ${pkmName}'s ${statName} stat stage to be ${expectedStage}, but got ${actualStage} instead!`,
|
||||
actual: actualStage,
|
||||
expected: expectedStage,
|
||||
};
|
||||
|
@ -3,13 +3,6 @@ import { isPokemonInstance, receivedStr } from "#test/test-utils/test-utils";
|
||||
import { toDmgValue } from "#utils/common";
|
||||
import type { MatcherState, SyncExpectationResult } from "@vitest/expect";
|
||||
|
||||
//#region Types
|
||||
|
||||
export interface ToHaveTakenDamageMatcherOptions {
|
||||
/** Whether to skip the internal {@linkcode toDmgValue} call. @defaultValue false */
|
||||
skipToDmgValue?: boolean;
|
||||
} //#endregion
|
||||
|
||||
/**
|
||||
* Matcher to check if a Pokemon has taken a specific amount of damage.
|
||||
* Unless specified, will run the expected damage value through {@linkcode toDmgValue}
|
||||
@ -42,7 +35,7 @@ export function toHaveTakenDamageMatcher(
|
||||
message: () =>
|
||||
pass
|
||||
? `Expected ${pkmName} to NOT have taken ${expectedDmgValue} damage, but it did!`
|
||||
: `Expected ${pkmName} to have taken ${expectedDmgValue} damage, but got ${actualDmgValue}!`,
|
||||
: `Expected ${pkmName} to have taken ${expectedDmgValue} damage, but got ${actualDmgValue} instead!`,
|
||||
expected: expectedDmgValue,
|
||||
actual: actualDmgValue,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user