mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-12 01:26:21 +00:00
Update tests to use vi instead of jest
This commit is contained in:
@@ -18,12 +18,12 @@ import type { Visit } from '../../../src/visits/types';
|
||||
describe('shortUrlVisitsReducer', () => {
|
||||
const now = new Date();
|
||||
const visitsMocks = rangeOf(2, () => fromPartial<Visit>({}));
|
||||
const getShortUrlVisitsCall = jest.fn();
|
||||
const getShortUrlVisitsCall = vi.fn();
|
||||
const buildApiClientMock = () => fromPartial<ShlinkApiClient>({ getShortUrlVisits: getShortUrlVisitsCall });
|
||||
const getShortUrlVisits = getShortUrlVisitsCreator(buildApiClientMock);
|
||||
const { reducer, cancelGetVisits: cancelGetShortUrlVisits } = shortUrlVisitsReducerCreator(getShortUrlVisits);
|
||||
|
||||
beforeEach(jest.clearAllMocks);
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
describe('reducer', () => {
|
||||
const buildState = (data: Partial<ShortUrlVisits>) => fromPartial<ShortUrlVisits>(data);
|
||||
@@ -143,7 +143,7 @@ describe('shortUrlVisitsReducer', () => {
|
||||
});
|
||||
|
||||
describe('getShortUrlVisits', () => {
|
||||
const dispatchMock = jest.fn();
|
||||
const dispatchMock = vi.fn();
|
||||
const getState = () => fromPartial<ShlinkState>({
|
||||
shortUrlVisits: { cancelLoad: false },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user