pokemon-showdown/test/sim/abilities/mummy.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

43 lines
1.7 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Mummy', function () {
afterEach(function () {
battle.destroy();
});
it("should set the attacker's ability to Mummy when the user is hit by a contact move", function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: 'Cofagrigus', ability: 'mummy', moves: ['calmmind']}]});
battle.setPlayer('p2', {team: [{species: 'Mew', ability: 'synchronize', moves: ['aerialace']}]});
battle.makeChoices('move calmmind', 'move aerialace');
assert.equal(battle.p2.active[0].ability, 'mummy');
});
it("should not change certain abilities", function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: 'Cofagrigus', ability: 'mummy', moves: ['calmmind']}]});
battle.setPlayer('p2', {team: [{species: 'Greninja', ability: 'battlebond', moves: ['aerialace']}]});
battle.makeChoices('move calmmind', 'move aerialace');
assert.equal(battle.p2.active[0].ability, 'battlebond');
});
it(`should not activate before all damage calculation is complete`, function () {
battle = common.createBattle({gameType: 'doubles'});
battle.setPlayer('p1', {team: [
{species: 'Sableye', ability: 'toughclaws', moves: ['brutalswing']},
{species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk']},
]});
battle.setPlayer('p2', {team: [
{species: 'Cofagrigus', ability: 'mummy', moves: ['sleeptalk']},
{species: 'Hoopa', ability: 'shellarmor', moves: ['sleeptalk']},
]});
battle.makeChoices('move brutalswing, move sleeptalk', 'move sleeptalk, move sleeptalk');
assert.fainted(battle.p2.active[1]);
});
});