Skip to content

Commit 4776a3b

Browse files
committed
Always use mocks when running in NODE_ENV=‘test’ environment
1 parent ec54bd9 commit 4776a3b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/_api/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import config from '_config'
55

66
let apiMocks: any
77

8-
if (config.api.useMocks) {
8+
if (config.api.useMocks || process.env.NODE_ENV === 'test') {
99
apiMocks = require('./_mocks/')
1010
}
1111

src/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import App from './App'
66
import * as serviceWorker from './serviceWorker'
77

88
import authService from './_services/authService'
9-
import api from './_api'
9+
import api from './_api/'
1010

1111
// Mount the app only when auth services and api services are ready
1212
// this solves api mocks issue

0 commit comments

Comments
 (0)