pokemon-showdown/test/sim/abilities/normalize.js
Guangcong Luo a65faf263f
Stop using assert.strict.strictEqual (#7515)
It turns out that when I switched us from `assert` to `assert.strict`,
I didn't actually update any existing tests or tell anyone:

0df0d234f2

So apparently everyone else just kept on using `strictEqual`.

This will be a PR and also throw an error if people continue trying to
use it, which should make it much clearer what PS policy is on this.

A lot of the problem may be that TypeScript marks assert.strict.equal
as deprecated when it's not. This was fixed 4 days ago:

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48452

But this probably hasn't made it to a thing yet. Until then, you'll
have to deal with TS marking your tests as deprecated, but it shouldn't
be too long.

Accidentally using `assert` instead of `assert.strict` should now show
an error. This protects against the probably much worse mistake of
accidentally using `assert.equal` rather than `assert.strict.equal`.

`assert.ok` is also deprecated now.
2020-10-14 01:19:03 -07:00

103 lines
4.5 KiB
JavaScript

'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Normalize', function () {
afterEach(function () {
battle.destroy();
});
it('should change most of the user\'s moves to Normal-type', function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', moves: ['grassknot']}]});
battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]});
battle.makeChoices('move grassknot', 'move endure');
assert(battle.p2.active[0].hasType('Normal'));
});
it('should not change Hidden Power to Normal-type', function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', moves: ['hiddenpowerfighting']}]});
battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]});
battle.makeChoices('move hiddenpowerfighting', 'move endure');
assert(battle.p2.active[0].hasType('Fighting'));
});
it('should not change Techno Blast to Normal-type if the user is holding a Drive', function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'dousedrive', moves: ['technoblast']}]});
battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]});
battle.makeChoices('move technoblast', 'move endure');
assert(battle.p2.active[0].hasType('Water'));
});
it('should not change Judgment to Normal-type if the user is holding a Plate', function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'zapplate', moves: ['judgment']}]});
battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]});
battle.makeChoices('move judgment', 'move endure');
assert(battle.p2.active[0].hasType('Electric'));
});
it('should not change Weather Ball to Normal-type if sun, rain, or hail is an active weather', function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'laggingtail', moves: ['weatherball']}]});
battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['sunnyday']}]});
battle.makeChoices('move weatherball', 'move sunnyday');
assert(battle.p2.active[0].hasType('Fire'));
});
it('should not change Natural Gift to Normal-type if the user is holding a Berry', function () {
battle = common.createBattle();
battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'chopleberry', moves: ['naturalgift']}]});
battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]});
battle.makeChoices('move naturalgift', 'move endure');
assert(battle.p2.active[0].hasType('Fighting'));
});
});
describe('Normalize [Gen 4]', function () {
afterEach(function () {
battle.destroy();
});
it('should change most of the user\'s moves to Normal-type', function () {
battle = common.gen(4).createBattle([
[{species: "Delcatty", ability: 'normalize', moves: ['grassknot']}],
[{species: "Latias", ability: 'colorchange', moves: ['endure']}],
]);
battle.makeChoices('move grassknot', 'move endure');
assert(battle.p2.active[0].hasType('Normal'));
});
it('should change Hidden Power to Normal-type', function () {
battle = common.gen(4).createBattle([
[{species: "Delcatty", ability: 'normalize', moves: ['hiddenpowerfire']}],
[{species: "Latias", ability: 'colorchange', moves: ['endure']}],
]);
battle.makeChoices('move hiddenpowerfire', 'move endure');
assert(battle.p2.active[0].hasType('Normal'));
});
it('should change Judgment to Normal-type even if the user is holding a Plate', function () {
battle = common.gen(4).createBattle([
[{species: "Delcatty", ability: 'normalize', item: 'pixieplate', moves: ['judgment']}],
[{species: "Latias", ability: 'colorchange', moves: ['endure']}],
]);
battle.makeChoices('move judgment', 'move endure');
assert(battle.p2.active[0].hasType('Normal'));
});
it('should change Weather Ball to Normal-type even if sun, rain, or hail is an active weather', function () {
battle = common.gen(4).createBattle([
[{species: "Delcatty", ability: 'normalize', item: 'laggingtail', moves: ['weatherball']}],
[{species: "Latias", ability: 'colorchange', moves: ['sunnyday']}],
]);
battle.makeChoices('move weatherball', 'move sunnyday');
assert(battle.p2.active[0].hasType('Normal'));
});
});