mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-09 18:49:18 -05:00
This makes it so we can use `assert.equal` instead of `assert.strictEqual`, which I think is more readable.
22 lines
703 B
JavaScript
22 lines
703 B
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Aftermath', function () {
|
|
afterEach(function () {
|
|
battle.destroy();
|
|
});
|
|
|
|
it("should hurt attackers by 1/4 their max HP when this Pokemon is KOed by a contact move", function () {
|
|
battle = common.createBattle();
|
|
battle.setPlayer('p1', {team: [{species: 'Galvantula', moves: ['lunge']}]});
|
|
battle.setPlayer('p2', {team: [{species: 'Shiftry', ability: 'aftermath', moves: ['sleeptalk']}]});
|
|
battle.makeChoices('move lunge', 'move sleeptalk');
|
|
const attacker = battle.p1.active[0];
|
|
assert.equal(attacker.hp, attacker.maxhp - Math.floor(attacker.maxhp / 4));
|
|
});
|
|
});
|