mirror of
				https://github.com/pagefaultgames/pokerogue.git
				synced 2025-10-31 08:25:58 +01:00 
			
		
		
		
	* move test folder * Update vitest files * rename test/utils to test/testUtils * Remove stray utils/gameManager Got put back from a rebase
		
			
				
	
	
		
			36 lines
		
	
	
		
			901 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			901 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { LoadingScene } from "#app/loading-scene";
 | |
| import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
 | |
| import GameManager from "#test/testUtils/gameManager";
 | |
| 
 | |
| describe("BattleScene", () => {
 | |
|   let phaserGame: Phaser.Game;
 | |
|   let game: GameManager;
 | |
| 
 | |
|   beforeAll(() => {
 | |
|     phaserGame = new Phaser.Game({
 | |
|       type: Phaser.HEADLESS,
 | |
|     });
 | |
|   });
 | |
| 
 | |
|   beforeEach(() => {
 | |
|     game = new GameManager(phaserGame);
 | |
|   });
 | |
| 
 | |
|   afterEach(() => {
 | |
|     game.phaseInterceptor.restoreOg();
 | |
|   });
 | |
| 
 | |
|   it("should remove LoadingScene on create", () => {
 | |
|     // `BattleScene.create()` is called during the `new GameManager()` call
 | |
|     expect(game.scene.scene.remove).toHaveBeenCalledWith(LoadingScene.KEY);
 | |
|   });
 | |
| 
 | |
|   it("should also reset RNG on reset", () => {
 | |
|     vi.spyOn(game.scene, "resetSeed");
 | |
| 
 | |
|     game.scene.reset();
 | |
| 
 | |
|     expect(game.scene.resetSeed).toHaveBeenCalled();
 | |
|   });
 | |
| });
 |