File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import { vi } from 'vitest' ;
22
33export function muteConsole ( ) {
4- vi . spyOn ( global . console , 'log' ) . mockImplementation ( ( ) => {
4+ vi . spyOn ( globalThis . console , 'log' ) . mockImplementation ( ( ) => {
55 // Intentionally empty
66 } ) ;
7- vi . spyOn ( global . console , 'error' ) . mockImplementation ( ( ) => {
7+ vi . spyOn ( globalThis . console , 'error' ) . mockImplementation ( ( ) => {
88 // Intentionally empty
99 } ) ;
10- vi . spyOn ( global . console , 'warn' ) . mockImplementation ( ( ) => {
10+ vi . spyOn ( globalThis . console , 'warn' ) . mockImplementation ( ( ) => {
1111 // Intentionally empty
1212 } ) ;
1313}
1414
1515export function restoreConsole ( ) {
16- vi . mocked ( global . console . log ) . mockRestore ( ) ;
17- vi . mocked ( global . console . error ) . mockRestore ( ) ;
18- vi . mocked ( global . console . warn ) . mockRestore ( ) ;
16+ vi . mocked ( globalThis . console . log ) . mockRestore ( ) ;
17+ vi . mocked ( globalThis . console . error ) . mockRestore ( ) ;
18+ vi . mocked ( globalThis . console . warn ) . mockRestore ( ) ;
1919}
You can’t perform that action at this time.
0 commit comments