pokemon-showdown/test/simulator/moves/quash.js
Ivo Julca 67da1a1221 Test: Use the new common#createBattle method
- This cuts down tons of code that define player names, avatars,
and deal with Team Preview.
2016-06-17 05:45:22 -05:00

47 lines
1.7 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Quash', function () {
afterEach(function () {
battle.destroy();
});
it('should cause the target to move last if it has not moved yet', function () {
battle = common.createBattle({gameType: 'doubles'});
battle.join('p1', 'Guest 1', 1, [
{species: "Sableye", ability: 'prankster', moves: ['quash']},
{species: "Aggron", ability: 'sturdy', moves: ['earthquake']},
]);
battle.join('p2', 'Guest 2', 1, [
{species: "Arceus", ability: 'multitype', moves: ['voltswitch']},
{species: "Aerodactyl", ability: 'unnerve', moves: ['swift']},
{species: "Rotom", ability: 'levitate', moves: ['thunderbolt']},
]);
battle.choose('p1', 'move 1 2, move 1');
battle.choose('p2', 'move 1 2, move 1');
battle.choose('p2', 'switch 3, pass'); // Volt Switch
assert.strictEqual(battle.log[battle.lastMoveLine].split('|')[3], 'Swift');
});
it('should not cause the target to move again if it has already moved', function () {
battle = common.createBattle({gameType: 'doubles'});
battle.join('p1', 'Guest 1', 1, [
{species: "Sableye", ability: 'prankster', moves: ['quash']},
{species: "Aggron", ability: 'sturdy', moves: ['earthquake']},
]);
battle.join('p2', 'Guest 2', 1, [
{species: "Arceus", ability: 'multitype', moves: ['voltswitch']},
{species: "Aerodactyl", ability: 'unnerve', moves: ['extremespeed']},
{species: "Rotom", ability: 'levitate', moves: ['thunderbolt']},
]);
battle.choose('p1', 'move 1 2, move 1');
battle.choose('p2', 'move 1 2, move 1 1');
battle.choose('p2', 'switch 3, pass'); // Volt Switch
assert.notStrictEqual(battle.log[battle.lastMoveLine].split('|')[3], 'Extremespeed');
});
});