pokemon-showdown/test/simulator/abilities/magicguard.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

41 lines
1.5 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Magic Guard', function () {
afterEach(function () {
battle.destroy();
});
it('should prevent all non-attack damage', function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [
{species: 'Magikarp', ability: 'swiftswim', moves: ['splash']},
{species: 'Clefable', ability: 'magicguard', item: 'lifeorb', moves: ['doubleedge', 'mindblown']},
]);
battle.join('p2', 'Guest 2', 1, [{species: 'Crobat', ability: 'roughskin', moves: ['spikes', 'toxic']}]);
battle.makeChoices('move splash', 'move spikes');
battle.makeChoices('switch 2', 'move toxic');
assert.strictEqual(battle.p1.active[0].status, 'tox');
assert.fullHP(battle.p1.active[0]);
battle.makeChoices('move mindblown', 'move toxic');
battle.makeChoices('move doubleedge', 'move spikes');
assert.fullHP(battle.p1.active[0]);
});
it('should not be suppressed by Mold Breaker', function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [
{species: 'Magikarp', ability: 'swiftswim', moves: ['splash']},
{species: 'Clefable', ability: 'magicguard', moves: ['doubleedge']},
]);
battle.join('p2', 'Guest 2', 1, [{species: 'Haxorus', ability: 'moldbreaker', moves: ['stealthrock', 'roar']}]);
battle.makeChoices('move splash', 'move stealthrock');
battle.makeChoices('move splash', 'move roar');
assert.fullHP(battle.p1.active[0]);
});
});