pokemon-showdown/test/simulator/items/weaknesspolicy.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

35 lines
1.3 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Weakness Policy', function () {
afterEach(function () {
battle.destroy();
});
it('should be triggered by super effective hits', function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [{species: "Lucario", ability: 'justified', moves: ['aurasphere']}]);
battle.join('p2', 'Guest 2', 1, [{species: "Blissey", ability: 'naturalcure', item: 'weaknesspolicy', moves: ['softboiled']}]);
const holder = battle.p2.active[0];
battle.makeChoices('move aurasphere', 'move softboiled');
assert.false.holdsItem(holder);
assert.statStage(holder, 'atk', 2);
assert.statStage(holder, 'spa', 2);
});
it('should not be triggered by fixed damage moves', function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [{species: "Lucario", ability: 'justified', moves: ['seismictoss']}]);
battle.join('p2', 'Guest 2', 1, [{species: "Blissey", ability: 'naturalcure', item: 'weaknesspolicy', moves: ['softboiled']}]);
const holder = battle.p2.active[0];
battle.makeChoices('move seismictoss', 'move softboiled');
assert.holdsItem(holder);
assert.statStage(holder, 'atk', 0);
assert.statStage(holder, 'spa', 0);
});
});