pokemon-showdown/test/simulator/items/leftovers.js
Guangcong Luo df5d8b283e Fix mistakes in tests
So I've been working on a massive refactor to the choice system for,
like, over a week. It's still not done, but it's found some mistakes
in the tests that should be fixed.
2017-03-17 02:22:52 -05:00

30 lines
749 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.commitDecisions();
assert.strictEqual(p1.active[0].hp, 590);
p1.chooseSwitch(2).foe.chooseDefault();
p1.chooseSwitch(2);
assert.strictEqual(p1.active[0].hp, 630);
});
});