salix-front/test/vitest/setup-file.js

13 lines
355 B
JavaScript

// 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();
});