diff --git a/app/soapbox/__tests__/toast.test.tsx b/app/soapbox/__tests__/toast.test.tsx index 795c11493..bdeff2249 100644 --- a/app/soapbox/__tests__/toast.test.tsx +++ b/app/soapbox/__tests__/toast.test.tsx @@ -20,7 +20,7 @@ function renderApp() { } beforeAll(() => { - jest.spyOn(console, 'error').mockImplementation(() => {}); + vi.spyOn(console, 'error').mockImplementation(() => {}); }); afterEach(() => { diff --git a/app/soapbox/actions/__tests__/compose.test.ts b/app/soapbox/actions/__tests__/compose.test.ts index 58f83e537..f6c64c929 100644 --- a/app/soapbox/actions/__tests__/compose.test.ts +++ b/app/soapbox/actions/__tests__/compose.test.ts @@ -41,7 +41,7 @@ describe('uploadCompose()', () => { it('creates an alert if exceeds max size', async() => { const mockIntl = { - formatMessage: jest.fn().mockReturnValue('Image exceeds the current file size limit (10 Bytes)'), + formatMessage: vi.fn().mockReturnValue('Image exceeds the current file size limit (10 Bytes)'), } as unknown as IntlShape; const expectedActions = [ @@ -87,7 +87,7 @@ describe('uploadCompose()', () => { it('creates an alert if exceeds max size', async() => { const mockIntl = { - formatMessage: jest.fn().mockReturnValue('Video exceeds the current file size limit (10 Bytes)'), + formatMessage: vi.fn().mockReturnValue('Video exceeds the current file size limit (10 Bytes)'), } as unknown as IntlShape; const expectedActions = [ diff --git a/app/soapbox/actions/__tests__/me.test.ts b/app/soapbox/actions/__tests__/me.test.ts index 91fba12fa..0187ba093 100644 --- a/app/soapbox/actions/__tests__/me.test.ts +++ b/app/soapbox/actions/__tests__/me.test.ts @@ -7,10 +7,10 @@ import { AuthUserRecord, ReducerRecord } from 'soapbox/reducers/auth'; import { fetchMe, patchMe } from '../me'; -jest.mock('../../storage/kv-store', () => ({ +vi.mock('../../storage/kv-store', () => ({ __esModule: true, default: { - getItemOrError: jest.fn().mockReturnValue(Promise.resolve({})), + getItemOrError: vi.fn().mockReturnValue(Promise.resolve({})), }, })); diff --git a/app/soapbox/actions/__tests__/onboarding.test.ts b/app/soapbox/actions/__tests__/onboarding.test.ts index f786c7f90..15a10f93a 100644 --- a/app/soapbox/actions/__tests__/onboarding.test.ts +++ b/app/soapbox/actions/__tests__/onboarding.test.ts @@ -10,11 +10,11 @@ describe('checkOnboarding()', () => { }); beforeEach(() => { - mockGetItem = jest.fn().mockReturnValue(null); + mockGetItem = vi.fn().mockReturnValue(null); }); it('does nothing if localStorage item is not set', async() => { - mockGetItem = jest.fn().mockReturnValue(null); + mockGetItem = vi.fn().mockReturnValue(null); const state = rootState.setIn(['onboarding', 'needsOnboarding'], false); const store = mockStore(state); @@ -27,7 +27,7 @@ describe('checkOnboarding()', () => { }); it('does nothing if localStorage item is invalid', async() => { - mockGetItem = jest.fn().mockReturnValue('invalid'); + mockGetItem = vi.fn().mockReturnValue('invalid'); const state = rootState.setIn(['onboarding', 'needsOnboarding'], false); const store = mockStore(state); @@ -40,7 +40,7 @@ describe('checkOnboarding()', () => { }); it('dispatches the correct action', async() => { - mockGetItem = jest.fn().mockReturnValue('1'); + mockGetItem = vi.fn().mockReturnValue('1'); const state = rootState.setIn(['onboarding', 'needsOnboarding'], false); const store = mockStore(state); @@ -61,7 +61,7 @@ describe('startOnboarding()', () => { }); beforeEach(() => { - mockSetItem = jest.fn(); + mockSetItem = vi.fn(); }); it('dispatches the correct action', async() => { @@ -84,7 +84,7 @@ describe('endOnboarding()', () => { }); beforeEach(() => { - mockRemoveItem = jest.fn(); + mockRemoveItem = vi.fn(); }); it('dispatches the correct action', async() => { diff --git a/app/soapbox/components/ui/button/__tests__/button.test.tsx b/app/soapbox/components/ui/button/__tests__/button.test.tsx index 8d1f65ec9..f9c59c68a 100644 --- a/app/soapbox/components/ui/button/__tests__/button.test.tsx +++ b/app/soapbox/components/ui/button/__tests__/button.test.tsx @@ -27,7 +27,7 @@ describe('