mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-08-23 01:24:29 -05:00
Add a test for self-damage critical hits (#4954)
This commit is contained in:
committed by
Guangcong Luo
parent
09700645de
commit
09360e88ca
21
test/simulator/misc/critical.js
Normal file
21
test/simulator/misc/critical.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('./../../assert');
|
||||
const common = require('./../../common');
|
||||
|
||||
let battle;
|
||||
|
||||
describe('Critical hits', function () {
|
||||
afterEach(function () {
|
||||
battle.destroy();
|
||||
});
|
||||
|
||||
it('should not happen on self-hits', function () {
|
||||
battle = common.createBattle();
|
||||
battle.join('p1', 'Guest 1', 1, [{species: "Zubat", moves: ['confuseray']}]);
|
||||
battle.join('p2', 'Guest 2', 1, [{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')));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user