Update tests to use vi instead of jest

This commit is contained in:
Alejandro Celaya
2023-05-27 11:57:26 +02:00
parent e2cbb2713a
commit 07fcb4e016
117 changed files with 3699 additions and 325 deletions

View File

@@ -14,12 +14,12 @@ import {
import type { OrphanVisit } from '../../../src/visits/types';
describe('visitsOverviewReducer', () => {
const getVisitsOverview = jest.fn();
const getVisitsOverview = vi.fn();
const buildApiClientMock = () => fromPartial<ShlinkApiClient>({ getVisitsOverview });
const loadVisitsOverview = loadVisitsOverviewCreator(buildApiClientMock);
const { reducer } = visitsOverviewReducerCreator(loadVisitsOverview);
beforeEach(jest.clearAllMocks);
beforeEach(vi.clearAllMocks);
describe('reducer', () => {
const state = (payload: Partial<VisitsOverview> = {}) => fromPartial<VisitsOverview>(payload);
@@ -128,7 +128,7 @@ describe('visitsOverviewReducer', () => {
});
describe('loadVisitsOverview', () => {
const dispatchMock = jest.fn();
const dispatchMock = vi.fn();
const getState = () => fromPartial<ShlinkState>({});
it.each([