pokemon-showdown/test/sim/rulesets/sleepclausemod.js
André Bastos Dias 7d92a7e14e
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled
Normalize test code formatting (#12029)
2026-05-11 21:13:30 -05:00

39 lines
1.2 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 }, [[
{ species: "Paras", moves: ['spore'] },
], [
{ 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 }, [[
{ species: "Paras", moves: ['spore', 'tackle'] },
], [
{ 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');
});
});