File size: 896 Bytes
5c2ed06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';

const assert = require('./../../assert');
const common = require('./../../common');

let battle;

describe(`As One`, () => {
	afterEach(() => {
		battle.destroy();
	});

	it(`should work if the user is Transformed`, () => {
		battle = common.createBattle([[
			{ species: 'ditto', ability: 'imposter', moves: ['transform'] },
		], [
			{ species: 'calyrexshadow', ability: 'asonespectrier', item: 'cheriberry', moves: ['glare', 'sleeptalk', 'astralbarrage'] },
			{ species: 'wynaut', moves: ['sleeptalk'] },
		]]);

		const ditto = battle.p1.active[0];
		const calyrex = battle.p2.active[0];
		battle.makeChoices('move glare', 'move sleeptalk');
		assert.equal(calyrex.status, 'par', `Calyrex should not have eaten its Berry, being affected by Ditto-Calyrex's Unnerve`);

		battle.makeChoices('move astralbarrage', 'move sleeptalk');
		assert.statStage(ditto, 'spa', 1);
	});
});