jest.requireActual --> vi.importActual

This commit is contained in:
Alex Gleason 2023-09-15 19:51:40 -05:00
parent da49327b35
commit 215221f64f
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,10 +1,10 @@
import { jest } from '@jest/globals';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import LinkHeader from 'http-link-header'; import LinkHeader from 'http-link-header';
import { vi } from 'vitest';
import type { AxiosInstance, AxiosResponse } from 'axios'; import type { AxiosInstance, AxiosResponse } from 'axios';
const api = jest.requireActual('../index') as Record<string, Function>; const api = await vi.importActual('../index') as Record<string, Function>;
let mocks: Array<Function> = []; let mocks: Array<Function> = [];
export const __stub = (func: (mock: MockAdapter) => void) => mocks.push(func); export const __stub = (func: (mock: MockAdapter) => void) => mocks.push(func);