diff --git a/test/vitest/setup-file.js b/test/vitest/setup-file.js index 288f80beb..4e494552f 100644 --- a/test/vitest/setup-file.js +++ b/test/vitest/setup-file.js @@ -1 +1,12 @@ // This file will be run before each test file, don't delete or vitest will not work. +import { vi, beforeEach, afterEach } from 'vitest'; + +beforeEach(() => { + vi.spyOn(console, 'warn').mockImplementation((message) => { + throw new Error(`Test failed due to console.warn: ${message}`); + }); +}); + +afterEach(() => { + vi.restoreAllMocks(); +});