diff --git a/packages/sanity/src/core/preview/utils/replayLatest.test.ts b/packages/sanity/src/core/preview/utils/replayLatest.test.ts index 03796d77b382..5b0b52f3f219 100644 --- a/packages/sanity/src/core/preview/utils/replayLatest.test.ts +++ b/packages/sanity/src/core/preview/utils/replayLatest.test.ts @@ -1,6 +1,6 @@ -import {expect, test} from '@jest/globals' import {concat, from, lastValueFrom, of, share, timer} from 'rxjs' import {concatMap, delay, mergeMap, take, toArray} from 'rxjs/operators' +import {expect, test} from 'vitest' import {shareReplayLatest} from './shareReplayLatest' diff --git a/packages/sanity/src/core/releases/components/__tests__/ReleasesMenu.test.tsx b/packages/sanity/src/core/releases/components/__tests__/ReleasesMenu.test.tsx index 27a8816fb9eb..5e98b37808bf 100644 --- a/packages/sanity/src/core/releases/components/__tests__/ReleasesMenu.test.tsx +++ b/packages/sanity/src/core/releases/components/__tests__/ReleasesMenu.test.tsx @@ -1,8 +1,8 @@ -import {beforeEach, describe, expect, it, jest} from '@jest/globals' import {fireEvent, render, screen, within} from '@testing-library/react' import userEvent from '@testing-library/user-event' import {act} from 'react' import {type BundleDocument, useBundles} from 'sanity' +import {beforeEach, describe, expect, it, vi} from 'vitest' import {createTestProvider} from '../../../../../test/testUtils/TestProvider' import {Button} from '../../../../ui-components' @@ -10,25 +10,25 @@ import {usePerspective} from '../../hooks/usePerspective' import {LATEST} from '../../util/const' import {ReleasesMenu} from '../ReleasesMenu' -jest.mock('../../hooks/usePerspective', () => ({ - usePerspective: jest.fn().mockReturnValue({ +vi.mock('../../hooks/usePerspective', () => ({ + usePerspective: vi.fn().mockReturnValue({ currentGlobalBundle: {}, - setPerspective: jest.fn(), + setPerspective: vi.fn(), }), })) -jest.mock('../../util/util', () => ({ - isDraftOrPublished: jest.fn(), +vi.mock('../../util/util', () => ({ + isDraftOrPublished: vi.fn(), })) -jest.mock('../../../store/bundles/useBundles', () => ({ - useBundles: jest.fn().mockReturnValue({deletedBundles: {}}), +vi.mock('../../../store/bundles/useBundles', () => ({ + useBundles: vi.fn().mockReturnValue({deletedBundles: {}}), })) -const mockUseBundles = useBundles as jest.Mock +const mockUseBundles = useBundles as Mock describe('ReleasesMenu', () => { - const mockUsePerspective = usePerspective as jest.Mock + const mockUsePerspective = usePerspective as Mock const ButtonTest =