pokemon-showdown/test/simulator/items/leftovers.js
Konrad Borowski 815909eff2 Don't skip residuals after fainting in Gen2.
The original code was wrong, as all it did was skipping residuals.
Skipping moves is handled by `faintMessages`.
2015-02-21 11:37:39 +01:00

28 lines
758 B
JavaScript

var assert = require('assert');
var battle;
describe('Leftovers - GSC', function () {
afterEach(function () {
battle.destroy();
});
it('should heal after switch', function () {
battle = BattleEngine.Battle.construct('battle-leftovers-gsc', 'gen2customgame');
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(battle.p1.active[0].hp, 614);
battle.choose('p1', 'switch 2');
battle.commitDecisions();
battle.choose('p1', 'switch 2');
assert.strictEqual(battle.p1.active[0].hp, 656);
});
});