mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-20 17:47:25 -05:00
This makes it so we can use `assert.equal` instead of `assert.strictEqual`, which I think is more readable.
33 lines
1.3 KiB
JavaScript
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');
|
|
});
|
|
});
|