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

39 lines
1.5 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Damp', function () {
afterEach(function () {
battle.destroy();
});
it('should prevent self-destruction moves from activating', function () {
battle = common.createBattle();
const p1 = battle.join('p1', 'Guest 1', 1, [{species: 'Politoed', ability: 'damp', moves: ['calmmind']}]);
const p2 = battle.join('p2', 'Guest 2', 1, [{species: 'Electrode', ability: 'static', moves: ['explosion']}]);
battle.makeChoices('move calmmind', 'move explosion');
assert.fullHP(p1.active[0]);
assert.fullHP(p2.active[0]);
});
it('should prevent Aftermath from activating', function () {
battle = common.createBattle();
const p1 = battle.join('p1', 'Guest 1', 1, [{species: 'Poliwrath', ability: 'damp', moves: ['closecombat']}]);
const p2 = battle.join('p2', 'Guest 2', 1, [{species: 'Aron', ability: 'aftermath', moves: ['leer']}]);
battle.makeChoices('move closecombat', 'move leer');
assert.fullHP(p1.active[0]);
assert.fainted(p2.active[0]);
});
it('should be suppressed by Mold Breaker', function () {
battle = common.createBattle();
const p1 = battle.join('p1', 'Guest 1', 1, [{species: 'Politoed', ability: 'damp', moves: ['calmmind']}]);
const p2 = battle.join('p2', 'Guest 2', 1, [{species: 'Electrode', ability: 'moldbreaker', moves: ['explosion']}]);
assert.hurts(p1.active[0], () => battle.makeChoices('move calmmind', 'move explosion'));
assert.fainted(p2.active[0]);
});
});