pokemon-showdown/test/sim/dex.js
Guangcong Luo 7436c1f0f2 Remove import = and export =
`import =` and `export =` are really only intended for backwards
compatibility with CommonJS. While I really don't like the new module
system TC39 has designed for us, it's what we should be using, and
consistency is important.
2019-05-16 01:27:07 +04:00

34 lines
1.2 KiB
JavaScript

'use strict';
const assert = require('./../assert');
describe('Mod loader', function () {
it.skip('should work fine in any order', function () {
{
Chat.uncacheTree('./.sim-dist/dex');
let Dex = require('./../../../.sim-dist/dex').Dex;
assert.strictEqual(Dex.mod('gen2').getTemplate('nidoking').learnset.bubblebeam.join(','), '1M');
assert.strictEqual(Dex.mod('gen2').getMove('crunch').secondaries[0].boosts.def, undefined);
}
{
Chat.uncacheTree('./.sim-dist/dex');
let Dex = require('./../../../.sim-dist/dex').Dex;
Dex.mod('gen2').getTemplate('nidoking');
Dex.mod('gen4').getMove('crunch');
assert.strictEqual(Dex.mod('gen2').getTemplate('nidoking').learnset.bubblebeam.join(','), '1M');
assert.strictEqual(Dex.mod('gen2').getMove('crunch').secondaries[0].boosts.def, undefined);
}
});
});
describe('Dex#getEffect', function () {
it('returns the same object for the same id', function () {
assert.strictEqual(Dex.getEffect('Stealth Rock'), Dex.getEffect('stealthrock'));
assert.notStrictEqual(Dex.getEffect('move: Stealth Rock'), Dex.getEffect('stealthrock'));
});
it('does not return elements from the Object prototype', function () {
assert.false(Dex.getEffect('constructor').exists);
});
});