mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
Apply Bertie's nits from code review
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
This commit is contained in:
parent
6b500dc0c8
commit
87103c3097
@ -133,6 +133,8 @@ function getTmPoolForSpecies(
|
||||
): void {
|
||||
const [allowCommon, allowGreat, allowUltra] = allowedTiers;
|
||||
const tms = speciesTmMoves[speciesId];
|
||||
// Species with no learnable TMs (e.g. Ditto) don't have entries in the `speciesTmMoves` object,
|
||||
// so this is needed to avoid iterating over `undefined`
|
||||
if (tms == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ interface MockPokemonParams {
|
||||
/**
|
||||
* Construct an `EnemyPokemon` that can be used for testing
|
||||
* @param species - The species ID of the pokemon to create
|
||||
* @returns The newly created `EnemyPokemon`.
|
||||
* @todo Move this to a dedicated unit test util folder if more tests come to rely on it
|
||||
*/
|
||||
function createTestablePokemon(
|
||||
species: SpeciesId,
|
||||
@ -269,7 +271,7 @@ describe("Regression Tests - ai-moveset-gen.ts", () => {
|
||||
describe("getTmPoolForSpecies", () => {
|
||||
const { getTmPoolForSpecies } = __INTERNAL_TEST_EXPORTS;
|
||||
|
||||
it("should not crash when generating a moveset for Ditto", () => {
|
||||
it("should not crash when generating a moveset for Pokemon without TM moves", () => {
|
||||
pokemon = createTestablePokemon(SpeciesId.DITTO, { level: 50 });
|
||||
expect(() =>
|
||||
getTmPoolForSpecies(SpeciesId.DITTO, ULTRA_TIER_TM_LEVEL_REQUIREMENT, "", new Map(), new Map(), new Map(), [
|
||||
|
Loading…
Reference in New Issue
Block a user