Jofthomas's picture
Jofthomas HF staff
Upload 4781 files
5c2ed06 verified
raw
history blame contribute delete
659 Bytes
'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe('Critical hits', () => {
afterEach(() => {
battle.destroy();
});
it(`should not happen on self-hits`, () => {
battle = common.createBattle({ forceRandomChance: true }, [[
{ species: 'Zubat', moves: ['confuseray'] },
], [
{ species: 'Chansey', item: 'luckypunch', ability: 'superluck', moves: ['softboiled'] },
]]);
battle.makeChoices('move confuseray', 'move softboiled');
assert(battle.log.some(line => line.includes('[from] confusion')));
assert(battle.log.every(line => !line.startsWith('|-crit')));
});
});