pokemon-showdown/test/sim/misc/sleepclausemod.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

33 lines
1.3 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Sleep Clause Mod', () => {
afterEach(() => battle.destroy());
it('should prevent players from putting more than one of foe\'s Pokemon to sleep', () => {
battle = common.createBattle({sleepClause: true});
battle.setPlayer('p1', {team: [{species: "Paras", moves: ['spore']}]});
battle.setPlayer('p2', {team: [{species: "Magikarp", moves: ['splash']}, {species: "Feebas", moves: ['splash']}]});
battle.makeChoices('move spore', 'switch 2');
assert.equal(battle.p2.active[0].status, 'slp');
battle.makeChoices('move spore', 'switch 2');
assert.equal(battle.p2.active[0].status, '');
});
it('should not prevent Rest', () => {
battle = common.createBattle({sleepClause: true});
battle.setPlayer('p1', {team: [{species: "Paras", moves: ['spore', 'tackle']}]});
battle.setPlayer('p2', {team: [{species: "Feebas", moves: ['rest']}, {species: "Magikarp", moves: ['splash']}]});
battle.makeChoices('move spore', 'switch 2');
assert.equal(battle.p2.active[0].status, 'slp');
battle.makeChoices('move tackle', 'switch 2');
assert.equal(battle.p2.active[0].status, '');
battle.makeChoices('move tackle', 'move rest');
assert.equal(battle.p2.active[0].status, 'slp');
});
});