Skip to content

Commit 82d9366

Browse files
committed
Replace global with globalThis
1 parent bec75de commit 82d9366

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test-utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { vi } from 'vitest';
22

33
export 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

1515
export 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
}

0 commit comments

Comments
 (0)