mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Add more tests
This commit is contained in:
parent
77debd6cce
commit
ce1b45c8b9
|
|
@ -92,5 +92,23 @@ describe('Flower Gift', () => {
|
|||
assert.equal(battle.field.weather, 'raindance');
|
||||
assert.species(battle.p1.active[0], 'Cherrim');
|
||||
});
|
||||
|
||||
it(`transformed Cherrim should transform without Flower Gift`, () => {
|
||||
battle = common.gen(4).createBattle([[
|
||||
{ species: 'Ditto', moves: ['transform'] },
|
||||
], [
|
||||
{ species: 'Cherrim', moves: ['sleeptalk'] },
|
||||
{ species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] },
|
||||
{ species: 'Bulbasaur', ability: 'drizzle', moves: ['sleeptalk'] },
|
||||
]]);
|
||||
battle.makeChoices();
|
||||
battle.makeChoices('move sleeptalk', 'switch 2');
|
||||
|
||||
assert.equal(battle.field.weather, 'sunnyday');
|
||||
assert.species(battle.p1.active[0], 'Cherrim-Sunshine');
|
||||
battle.makeChoices('auto', 'switch 3');
|
||||
assert.equal(battle.field.weather, 'raindance');
|
||||
assert.species(battle.p1.active[0], 'Cherrim');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
36
test/sim/abilities/forecast.js
Normal file
36
test/sim/abilities/forecast.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
const assert = require('./../../assert');
|
||||
const common = require('./../../common');
|
||||
|
||||
let battle;
|
||||
|
||||
describe('Forecast', () => {
|
||||
afterEach(() => {
|
||||
battle.destroy();
|
||||
});
|
||||
|
||||
it(`should revert form if it loses its ability`, () => {
|
||||
battle = common.createBattle([[
|
||||
{ species: "Castform", ability: 'forecast', moves: ['sleeptalk'] },
|
||||
], [
|
||||
{ species: "Groudon", ability: 'drought', moves: ['skillswap'] },
|
||||
]]);
|
||||
assert.species(battle.p1.active[0], 'Castform-Sunny');
|
||||
battle.makeChoices();
|
||||
assert.species(battle.p1.active[0], 'Castform');
|
||||
});
|
||||
|
||||
describe('[Gen 4]', () => {
|
||||
it(`should not revert form if it loses its ability`, () => {
|
||||
battle = common.gen(4).createBattle([[
|
||||
{ species: "Castform", ability: 'forecast', moves: ['sleeptalk'] },
|
||||
], [
|
||||
{ species: "Groudon", ability: 'drought', moves: ['skillswap'] },
|
||||
]]);
|
||||
assert.species(battle.p1.active[0], 'Castform-Sunny');
|
||||
battle.makeChoices();
|
||||
assert.species(battle.p1.active[0], 'Castform-Sunny');
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user