Migrate from Jest to Vitest (#34454)
This commit is contained in:
parent
741f166407
commit
8c579c5b34
18 changed files with 2344 additions and 2003 deletions
|
@ -3,17 +3,17 @@ import { IntlProvider } from 'react-intl';
|
|||
import { MemoryRouter } from 'react-router';
|
||||
|
||||
import type { RenderOptions } from '@testing-library/react';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { render as rtlRender } from '@testing-library/react';
|
||||
|
||||
import { IdentityContext } from './identity_context';
|
||||
|
||||
beforeEach(() => {
|
||||
global.requestIdleCallback = jest
|
||||
.fn()
|
||||
.mockImplementation((fn: () => void) => {
|
||||
fn();
|
||||
});
|
||||
beforeAll(() => {
|
||||
global.requestIdleCallback = vi.fn((cb: IdleRequestCallback) => {
|
||||
// @ts-expect-error IdleRequestCallback expects an argument of type IdleDeadline,
|
||||
// but that doesn't exist in this environment.
|
||||
cb();
|
||||
return 0;
|
||||
});
|
||||
});
|
||||
|
||||
function render(
|
||||
|
@ -46,7 +46,6 @@ function render(
|
|||
}
|
||||
|
||||
// re-export everything
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
export * from '@testing-library/react';
|
||||
|
||||
// override render method
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue