Skip to content

Commit

Permalink
msw setup refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Belco90 committed Sep 7, 2022
1 parent 2e5c8f2 commit ea42700
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions src/msw/index.ts → src/mock-service-worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@ async function initMocks() {
}
}

void initMocks()

export {}
export { initMocks }
File renamed without changes.
3 changes: 2 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { AppProps } from 'next/app'

import { GithubAuthProvider } from '~/contexts/github-auth-provider'
import customTheme from '~/customTheme'
import { initMocks } from '~/mock-service-worker'
import DefaultSEO from '~/next-seo.config'

const queryClient = new QueryClient({
Expand All @@ -20,7 +21,7 @@ const queryClient = new QueryClient({
})

if (process.env.NEXT_PUBLIC_API_MOCKING === 'enabled') {
require('~/msw')
void initMocks()
}

const App = ({ Component, pageProps }: AppProps) => {
Expand Down

0 comments on commit ea42700

Please sign in to comment.