pokemon-showdown/test/sim/abilities/roughskin.js
Guangcong Luo 229f5f809d Use assert in strict mode
This makes it so we can use `assert.equal` instead of
`assert.strictEqual`, which I think is more readable.
2020-02-20 00:39:31 -08:00

23 lines
718 B
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Rough Skin', function () {
afterEach(function () {
battle.destroy();
});
// Yes, we really need a test for this
it("should not activate twice on moves with secondary effects", function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk']}]});
battle.setPlayer('p2', {team: [{species: 'Pachirisu', ability: 'voltabsorb', moves: ['nuzzle']}]});
battle.makeChoices('auto', 'move nuzzle');
const pachi = battle.p2.active[0];
assert.equal(pachi.hp, Math.ceil(pachi.maxhp - pachi.maxhp / 8));
});
});