All files / lib/jsdom/patch jsdom-globals.patch.ts

100% Statements 14/14
100% Branches 0/0
100% Functions 4/4
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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    12x 12x 12x 12x   12x           12x 12x 12x 12x         12x 12x    
import { vi } from 'vitest';
 
import { setupDocumentMocks } from '../document/document.mock';
import { d3MockValue } from '../external/d3.mock';
import { setupGlobalMocks } from '../globals/globals.mock';
import { setupWindowMocks } from '../window/window.mock';
 
vi.mock('d3', () => d3MockValue);
 
/**
 * Sets up  global mocks
 * which should be used in each app and lib in test-setup.ts files.
 */
export const setupJsdomGlobalMocks: () => void = () => {
  setupGlobalMocks();
  setupWindowMocks();
  setupDocumentMocks();
 
  /**
   * Override some console methods for testing environment.
   */
  window.console.log = (): void => void 0;
  window.console.group = (): void => void 0;
};