mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-21 06:37:09 -05:00
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.
30 lines
749 B
JavaScript
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);
|
|
});
|
|
});
|