mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-11 23:14:13 -05:00
37 lines
972 B
JavaScript
37 lines
972 B
JavaScript
'use strict';
|
|
|
|
const assert = require('./../../assert');
|
|
const common = require('./../../common');
|
|
|
|
let battle;
|
|
|
|
describe('Disable', function () {
|
|
afterEach(function () {
|
|
battle.destroy();
|
|
});
|
|
|
|
it(`should prevent the use of the target's last move`, function () {
|
|
battle = common.createBattle([[
|
|
{species: 'Wynaut', moves: ['disable']},
|
|
], [
|
|
{species: 'Spearow', moves: ['growl']},
|
|
]]);
|
|
|
|
battle.makeChoices();
|
|
assert.cantMove(() => battle.makeChoices('auto', 'move growl'), 'Spearow', 'growl');
|
|
});
|
|
|
|
it(`should interupt consecutively executed moves like Outrage`, function () {
|
|
battle = common.createBattle([[
|
|
{species: 'Wynaut', moves: ['disable']},
|
|
], [
|
|
{species: 'Spearow', moves: ['outrage', 'sleeptalk']},
|
|
]]);
|
|
|
|
battle.makeChoices();
|
|
assert.cantMove(() => battle.makeChoices('auto', 'move sleeptalk'), 'Spearow', 'sleeptalk');
|
|
battle.makeChoices();
|
|
assert.cantMove(() => battle.makeChoices('auto', 'move outrage'));
|
|
});
|
|
});
|