Add more tests

This commit is contained in:
andrebastosdias 2026-04-19 22:14:42 +01:00
parent 77debd6cce
commit ce1b45c8b9
2 changed files with 54 additions and 0 deletions

View File

@ -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');
});
});
});

View 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');
});
});
});