Fixed type error oopsie

This commit is contained in:
Bertie690 2025-09-21 15:22:12 -04:00
parent c4e2022e18
commit 7da255fe57
3 changed files with 15 additions and 7 deletions

View File

@ -236,7 +236,7 @@
}, },
"overrides": [ "overrides": [
{ {
"includes": ["**/test/**/*.test.ts"], "includes": ["**/test/**/*.ts"],
"linter": { "linter": {
"rules": { "rules": {
"performance": { "performance": {
@ -245,8 +245,16 @@
}, },
"style": { "style": {
"noNonNullAssertion": "off" // tedious in some tests "noNonNullAssertion": "off" // tedious in some tests
}, }
}
}
},
{
"includes": ["**/test/**/*.test.ts"],
"linter": {
"rules": {
"nursery": { "nursery": {
// TODO: Enable for normal test folder files as well
"noFloatingPromises": "error" "noFloatingPromises": "error"
} }
} }

View File

@ -5,6 +5,6 @@ import { sortInSpeedOrder } from "#app/utils/speed-order";
/** A priority queue of {@linkcode Pokemon}s */ /** A priority queue of {@linkcode Pokemon}s */
export class PokemonPriorityQueue extends PriorityQueue<Pokemon> { export class PokemonPriorityQueue extends PriorityQueue<Pokemon> {
protected override reorder(): void { protected override reorder(): void {
this.queue = sortInSpeedOrder(this.queue); sortInSpeedOrder(this.queue);
} }
} }

View File

@ -539,16 +539,16 @@ export class GameManager {
} }
/** /**
* Override the speed order of the battle's current combatants. * Override the turn order of the battle's current combatants.
* Used to manually modify Pokemon turn order. * @param order - The turn order to set, as an array of {@linkcode BattlerIndex}es
* @param order - The turn order to set as an array of {@linkcode BattlerIndex}es
* @example * @example
* ```ts * ```ts
* game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER_2]); * game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER_2]);
* ``` * ```
* @throws Fails test immediately if `order` does not contain all non-fainted combatants' `BattlerIndex`es. * @throws Fails test immediately if `order` does not contain all non-fainted combatants' `BattlerIndex`es.
* @remarks * @remarks
* This does not account for priority, the battlers' relative speed stats. * This does not account for priority, nor does it change the battlers' speed stats
* (for the purposes of Electro Ball, etc).
* @todo What should happen if the number of active battlers changes mid-test? * @todo What should happen if the number of active battlers changes mid-test?
*/ */
public setTurnOrder(order: Exclude<BattlerIndex, BattlerIndex.ATTACKER>[]): void { public setTurnOrder(order: Exclude<BattlerIndex, BattlerIndex.ATTACKER>[]): void {