Skip to content

Commit

Permalink
fix: converted from jest to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalee committed Nov 1, 2024
1 parent 42ca901 commit dadc517
Show file tree
Hide file tree
Showing 72 changed files with 2,376 additions and 5,569 deletions.
16 changes: 16 additions & 0 deletions compose/neurosynth-frontend/__mocks__/@auth0/auth0-react.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { vi } from 'vitest';

const useAuth0 = vi.fn().mockReturnValue({
getAccessTokenSilently: vi.fn().mockImplementation(() => {
return Promise.resolve('test-token');
}),
loginWithPopup: vi.fn(),
logout: vi.fn(),
isAuthenticated: false,
isLoading: false,
user: {
sub: 'some-github-user',
},
});

export { useAuth0 };
7 changes: 7 additions & 0 deletions compose/neurosynth-frontend/__mocks__/notistack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { vi } from 'vitest';

const useSnackbar = vi.fn().mockReturnValue({
enqueueSnackbar: vi.fn(),
});

export { useSnackbar };
13 changes: 13 additions & 0 deletions compose/neurosynth-frontend/__mocks__/react-query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { vi } from 'vitest';

const useQueryClient = vi.fn().mockReturnValue({
invalidateQueries: vi.fn(),
});

const useQuery = vi.fn().mockReturnValue({
data: null,
isLoading: false,
isError: false,
});

export { useQueryClient, useQuery };
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { vi } from 'vitest';
import { NavigateProps } from 'react-router-dom';

const useParams = jest.fn().mockReturnValue({
const useParams = vi.fn().mockReturnValue({
projectId: 'test-project-id',
});

const useNavigate = jest.fn().mockReturnValue(jest.fn());
const useNavigate = vi.fn().mockReturnValue(vi.fn());

const useLocation = jest.fn().mockReturnValue({
const useLocation = vi.fn().mockReturnValue({
location: {
search: '',
},
Expand Down
16 changes: 0 additions & 16 deletions compose/neurosynth-frontend/jest.config.js

This file was deleted.

Loading

0 comments on commit dadc517

Please sign in to comment.