File size: 805 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
31
32
33
'use strict';

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

let battle;

describe('Free-for-all', () => {
	afterEach(() => {
		battle.destroy();
	});

	it(`should support forfeiting`, () => {
		battle = common.createBattle({ gameType: 'freeforall' }, [[
			{ species: 'wynaut', moves: ['vitalthrow'] },
		], [
			{ species: 'scyther', moves: ['sleeptalk'] },
		], [
			{ species: 'scyther', moves: ['sleeptalk', 'uturn'] },
			{ species: 'wynaut', moves: ['vitalthrow'] },
		], [
			{ species: 'scyther', moves: ['sleeptalk'] },
		]]);
		battle.makeChoices();
		battle.lose('p2');
		assert(battle.p2.activeRequest.wait);
		battle.makeChoices('auto', '', 'move uturn 1', 'auto');
		battle.lose('p3');
		battle.makeChoices();
		assert.equal(battle.turn, 4);
	});
});