mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-02 05:36:38 +00:00
Update tests to use vi instead of jest
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { HttpClient } from '../../../src/common/services/HttpClient';
|
||||
|
||||
describe('HttpClient', () => {
|
||||
const fetch = jest.fn();
|
||||
const fetch = vi.fn();
|
||||
const httpClient = new HttpClient(fetch);
|
||||
|
||||
beforeEach(jest.clearAllMocks);
|
||||
beforeEach(vi.clearAllMocks);
|
||||
|
||||
describe('fetchJson', () => {
|
||||
it('throws json on success', async () => {
|
||||
|
||||
@@ -4,12 +4,12 @@ import { ImageDownloader } from '../../../src/common/services/ImageDownloader';
|
||||
import { windowMock } from '../../__mocks__/Window.mock';
|
||||
|
||||
describe('ImageDownloader', () => {
|
||||
const fetchBlob = jest.fn();
|
||||
const fetchBlob = vi.fn();
|
||||
const httpClient = fromPartial<HttpClient>({ fetchBlob });
|
||||
let imageDownloader: ImageDownloader;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
vi.clearAllMocks();
|
||||
(global as any).URL = { createObjectURL: () => '' };
|
||||
|
||||
imageDownloader = new ImageDownloader(httpClient, windowMock);
|
||||
|
||||
@@ -4,10 +4,10 @@ import type { NormalizedVisit } from '../../../src/visits/types';
|
||||
import { windowMock } from '../../__mocks__/Window.mock';
|
||||
|
||||
describe('ReportExporter', () => {
|
||||
const jsonToCsv = jest.fn();
|
||||
const jsonToCsv = vi.fn();
|
||||
let exporter: ReportExporter;
|
||||
|
||||
beforeEach(jest.clearAllMocks);
|
||||
beforeEach(vi.clearAllMocks);
|
||||
beforeEach(() => {
|
||||
(global as any).Blob = class Blob {};
|
||||
(global as any).URL = { createObjectURL: () => '' };
|
||||
|
||||
Reference in New Issue
Block a user