mirror of
				https://github.com/pagefaultgames/pokerogue.git
				synced 2025-11-04 02:11:19 +01:00 
			
		
		
		
	* Reuse global scene between tests Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com> * Add missing each method to mockContainer * Fix select-modifier-phase test * Sanitize overrides before tests Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com> * Sanitize overrides before tests Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com> * [WIP] fix things * Fix tests not working with --no-isolate * Update npm tests to use no isolate * Update test-shard-template * Update package.json Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --------- Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
		
			
				
	
	
		
			27 lines
		
	
	
		
			484 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			484 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
/**
 | 
						|
 * A minimal stub object to mock HTMLCanvasElement
 | 
						|
 */
 | 
						|
export const mockCanvas: any = {
 | 
						|
  width: 0,
 | 
						|
  getContext() {
 | 
						|
    return mockContext;
 | 
						|
  },
 | 
						|
};
 | 
						|
/**
 | 
						|
 * A minimal stub object to mock CanvasRenderingContext2D
 | 
						|
 */
 | 
						|
export const mockContext: any = {
 | 
						|
  font: "",
 | 
						|
  measureText: () => {
 | 
						|
    return {};
 | 
						|
  },
 | 
						|
  save: () => {},
 | 
						|
  scale: () => {},
 | 
						|
  clearRect: () => {},
 | 
						|
  fillRect: () => {},
 | 
						|
  fillText: () => {},
 | 
						|
  getImageData: () => {},
 | 
						|
  canvas: mockCanvas,
 | 
						|
  restore: () => {},
 | 
						|
};
 |