Skip to content
Snippets Groups Projects

test: test unitaire. Ref #4

Merged AIT LAMINE Ilias requested to merge ilias_branch into main
3 files
+ 21
29
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 3
24
import {fetchPokemonList} from './pokemonProvider.js';
function getPokemons(pokemons) {
const list = pokemons;
console.log(list);
function filterPokemons(pokemons) {
return pokemons.filter(pokemon => pokemon.weight > 3 && pokemon.height < 1);
}
/**
* Filter Pokémon with weight > 3kg and height < 1m
*/
function filterPokemons() {
fetchPokemonList((pokemons) => {
const filteredPokemons = pokemons.filter(pokemon => pokemon.weight > 3 );
displayPokemons(filteredPokemons);
}, 318); // Fetch 318 Pokémon
}
function filterPokemons2() {
fetchPokemonList((pokemons) => {
const filteredPokemons = pokemons.filter(pokemon => pokemon.height < 1 );
displayPokemons(filteredPokemons);
}, 318); // Fetch 318 Pokémon
}
fetchPokemonList(getPokemons, 20);
\ No newline at end of file
module.exports = filterPokemons;
\ No newline at end of file
Loading