Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 478 B view raw
1// This script is run before each `.test.ts` file. 2globalThis.AbortController = undefined; 3globalThis.fetch = vi.fn(); 4 5process.on('unhandledRejection', error => { 6 throw error; 7}); 8 9const originalConsole = console; 10globalThis.console = { 11 ...originalConsole, 12 warn: (vi.SpyInstance = () => { 13 /* noop */ 14 }), 15 error: (vi.SpyInstance = message => { 16 throw new Error(message); 17 }), 18}; 19 20vi.spyOn(console, 'log'); 21vi.spyOn(console, 'warn'); 22vi.spyOn(console, 'error');