pokemon.js
Version:
A JavaScript library that makes interacting with PokeAPI easier
20 lines (19 loc) • 1.11 kB
JavaScript
const Pokemon = require('../src');
let count = 0;
if (Pokemon.setLanguage('english')) count++;
Pokemon.canLearn('shuckle', 'protect').then(count++).catch(console.log);
Pokemon.getAbility('lugia').then(count++).catch(console.log);
Pokemon.getAbility('prankster').then(count++).catch(console.log);
Pokemon.getEvolutionLine('torterra').then(count++).catch(console.log);
Pokemon.getForms('charizard').then(count++).catch(console.log);
Pokemon.getPokemon('pikachu').then(count++).catch(console.log);
Pokemon.getSprites('lucario').then(count++).catch(console.log);
Pokemon.getStats('rayquaza').then(count++).catch(console.log);
Pokemon.getType('squirtle').then(count++).catch(console.log);
Pokemon.getType('water').then(count++).catch(console.log);
Pokemon.getItem('life orb').then(count++).catch(console.log);
Pokemon.getMove('ice beam').then(count++).catch(console.log);
Pokemon.getAll('region').then(count++).catch(console.log);
Pokemon.getGeneration('4').then(count++).catch(console.log);
Pokemon.getRegion('unova').then(count++).catch(console.log);
console.log(`${count} tests have been passed`);