pokemon-showdown/test/simulator/items/shedshell.js
Brandon Gottlob 27d3e4fc5b Refactor tests to use new makeChoices API (#4528)
See 8473c3f4fa for the example followed in the refactor
2018-03-30 16:06:14 -05:00

48 lines
1.8 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Shed Shell', function () {
afterEach(function () {
battle.destroy();
});
it('should allow Pokemon to escape trapping abilities', function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [{species: "Gothitelle", ability: 'shadowtag', moves: ['calmmind']}]);
battle.join('p2', 'Guest 2', 1, [
{species: "Starmie", ability: 'naturalcure', item: 'shedshell', moves: ['recover']},
{species: "Heatran", ability: 'flashfire', moves: ['rest']},
]);
battle.makeChoices('move calmmind', 'switch 2');
assert.species(battle.p2.active[0], 'Heatran');
});
it('should allow Pokemon to escape from most moves that would trap them', function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [{species: "Gengar", ability: 'levitate', moves: ['meanlook']}]);
battle.join('p2', 'Guest 2', 1, [
{species: "Venusaur", ability: 'overgrow', item: 'shedshell', moves: ['ingrain']},
{species: "Heatran", ability: 'flashfire', moves: ['rest']},
]);
battle.makeChoices('move meanlook', 'move ingrain');
battle.makeChoices('move meanlook', 'switch 2');
assert.species(battle.p2.active[0], 'Heatran');
});
it('should not allow Pokemon to escape from Sky Drop', function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [{species: "Dragonite", ability: 'multiscale', moves: ['skydrop']}]);
battle.join('p2', 'Guest 2', 1, [
{species: "Magnezone", ability: 'sturdy', item: 'shedshell', moves: ['sleeptalk']},
{species: "Heatran", ability: 'flashfire', moves: ['rest']},
]);
battle.makeChoices('move skydrop', 'move sleeptalk');
battle.makeChoices('move skydrop', 'switch 2');
assert.species(battle.p2.active[0], 'Magnezone');
});
});