mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-02 13:51:48 +00:00
Update tests to use vi instead of jest
This commit is contained in:
@@ -8,17 +8,17 @@ const ComponentWithError = () => {
|
||||
};
|
||||
|
||||
describe('<ErrorHandler />', () => {
|
||||
const reload = jest.fn();
|
||||
const reload = vi.fn();
|
||||
const window = fromPartial<Window>({
|
||||
location: { reload },
|
||||
});
|
||||
const cons = fromPartial<Console>({ error: jest.fn() });
|
||||
const cons = fromPartial<Console>({ error: vi.fn() });
|
||||
const ErrorHandler = createErrorHandler(window, cons);
|
||||
|
||||
beforeEach(() => {
|
||||
jest.spyOn(console, 'error').mockImplementation(() => {}); // Silence react errors
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {}); // Silence react errors
|
||||
});
|
||||
afterEach(jest.resetAllMocks);
|
||||
afterEach(vi.resetAllMocks);
|
||||
|
||||
it('renders children when no error has occurred', () => {
|
||||
render(<ErrorHandler children={<span>Foo</span>} />);
|
||||
|
||||
Reference in New Issue
Block a user