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

30 lines
824 B
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Leftovers [Gen 2]', function () {
afterEach(function () {
battle.destroy();
});
it('should heal after switch', function () {
battle = common.gen(2).createBattle();
const p1 = battle.join('p1', 'Guest 1', 1, [
{species: 'Blissey', item: 'leftovers', moves: ['healbell']},
{species: 'Magikarp', level: 1, moves: ['splash']},
]);
battle.join('p2', 'Guest 2', 1, [
{species: "Miltank", moves: ['seismictoss']},
]);
battle.makeChoices('move healbell', 'move seismictoss');
assert.strictEqual(p1.active[0].hp, 590);
battle.makeChoices('switch 2', 'move seismictoss');
battle.makeChoices('switch 2', 'move seismictoss');
assert.strictEqual(p1.active[0].hp, 630);
});
});