Skip to content

Commit

Permalink
Fix all the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AarCon committed Jun 5, 2024
1 parent bb1ed4c commit 7d4cce6
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 55 deletions.
2 changes: 1 addition & 1 deletion __tests/egggroup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe("Dex Utils Egg Group Tests", () => {
describe("getPokemonInEggGroup", () => {
const validIds = [
{ id: 0, count: 1 },
{ id: 5, count: 404 },
{ id: 5, count: 403 },
{ id: 10, count: 100 },
];

Expand Down
109 changes: 55 additions & 54 deletions __tests/evolution.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,60 +240,61 @@ describe("getEvolutionTree", () => {
expect(thirdResult).toEqual(expected);
});

it("works for a Pokemon with a 2 stage branching Evolution (across the same gen)", () => {
const firstPokemonId = 789; // Cosmog
const secondPokemonId = 790; // Cosmeom
const thirdPokemonId = 791; // Solgaleo
const fourthPokemonId = 792; // Lunala
const firstResult = getEvolutionTree(firstPokemonId);
const secondResult = getEvolutionTree(secondPokemonId);
const thirdResult = getEvolutionTree(thirdPokemonId);
const fourthResult = getEvolutionTree(fourthPokemonId);
const expected = {
pokemonId: 789,
evolutionDetails: null,
evolvesInto: [
{
evolutionDetails: {
formNos: [0],
levels: [43],
methodIds: [4],
methodParameters: [0],
monsNos: [790],
},
evolvesInto: [
{
evolutionDetails: {
formNos: [0],
levels: [53],
methodIds: [32],
methodParameters: [0],
monsNos: [791],
},
evolvesInto: [],
pokemonId: 791,
},
{
evolutionDetails: {
formNos: [0],
levels: [53],
methodIds: [33],
methodParameters: [0],
monsNos: [792],
},
evolvesInto: [],
pokemonId: 792,
},
],
pokemonId: 790,
},
],
};
expect(firstResult).toEqual(expected) &&
expect(secondResult).toEqual(expected) &&
expect(thirdResult).toEqual(expected) &&
expect(fourthResult).toEqual(expected);
});
// Cosmog not available in 2.0
// it("works for a Pokemon with a 2 stage branching Evolution (across the same gen)", () => {
// const firstPokemonId = 789; // Cosmog
// const secondPokemonId = 790; // Cosmeom
// const thirdPokemonId = 791; // Solgaleo
// const fourthPokemonId = 792; // Lunala
// const firstResult = getEvolutionTree(firstPokemonId);
// const secondResult = getEvolutionTree(secondPokemonId);
// const thirdResult = getEvolutionTree(thirdPokemonId);
// const fourthResult = getEvolutionTree(fourthPokemonId);
// const expected = {
// pokemonId: 789,
// evolutionDetails: null,
// evolvesInto: [
// {
// evolutionDetails: {
// formNos: [0],
// levels: [43],
// methodIds: [4],
// methodParameters: [0],
// monsNos: [790],
// },
// evolvesInto: [
// {
// evolutionDetails: {
// formNos: [0],
// levels: [53],
// methodIds: [32],
// methodParameters: [0],
// monsNos: [791],
// },
// evolvesInto: [],
// pokemonId: 791,
// },
// {
// evolutionDetails: {
// formNos: [0],
// levels: [53],
// methodIds: [33],
// methodParameters: [0],
// monsNos: [792],
// },
// evolvesInto: [],
// pokemonId: 792,
// },
// ],
// pokemonId: 790,
// },
// ],
// };
// expect(firstResult).toEqual(expected) &&
// expect(secondResult).toEqual(expected) &&
// expect(thirdResult).toEqual(expected) &&
// expect(fourthResult).toEqual(expected);
// });

it("works for a Pokemon with many branching Evolutions (across multiple gens)", () => {
const firstPokemonId = 133; // Eevee
Expand Down

0 comments on commit 7d4cce6

Please sign in to comment.