File size: 929 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
34
'use strict';

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

let battle;

describe('Safety Goggles', () => {
	afterEach(() => {
		battle.destroy();
	});

	it(`should be revealed if Terrain is also active`, () => {
		battle = common.createBattle([[
			{ species: 'tapukoko', ability: 'electricsurge', item: 'safetygoggles', moves: ['sleeptalk'] },
		], [
			{ species: 'amoonguss', moves: ['spore'] },
		]]);
		battle.makeChoices();
		assert(battle.log.some(line => line.includes('|item: Safety Goggles|')));
	});

	it(`should be revealed if the move would have missed`, () => {
		battle = common.createBattle({ forceRandomChance: false }, [[
			{ species: 'yveltal', item: 'safetygoggles', moves: ['sleeptalk'] },
		], [
			{ species: 'venusaur', moves: ['sleeppowder'] },
		]]);

		battle.makeChoices();
		assert(battle.log.some(line => line.includes('|item: Safety Goggles|')));
	});
});