pokemon-showdown/test/simulator/misc/dex.js
Guangcong Luo 02055d3d17 Fix mod loading order
Sometimes mods would mess up if they were loaded in the wrong order.
Specifically, some autogenerated properties of e.g. moves need to be
recalculated for mods.

Anyway, the entire cache system is replaced with a newer, faster,
slightly-more-memory-intensive-but-only-slightly cache system, which
no longer has these kinds of loading order issues.
2016-10-23 14:17:13 -05:00

23 lines
807 B
JavaScript

'use strict';
const assert = require('./../../assert');
describe('Mod loader', function () {
it('should work fine in any order', function () {
{
Chat.uncacheTree('./tools');
let Tools = require('./../../../tools');
assert.strictEqual(Tools.mod('gen2').getTemplate('nidoking').learnset.bubblebeam.join(','), '1M');
assert.strictEqual(Tools.mod('gen2').getMove('crunch').secondaries[0].boosts.def, undefined);
}
{
Chat.uncacheTree('./tools');
let Tools = require('./../../../tools');
Tools.mod('gen2').getTemplate('nidoking');
Tools.mod('gen4').getMove('crunch');
assert.strictEqual(Tools.mod('gen2').getTemplate('nidoking').learnset.bubblebeam.join(','), '1M');
assert.strictEqual(Tools.mod('gen2').getMove('crunch').secondaries[0].boosts.def, undefined);
}
});
});