Enable msw file server for DoesItAPI

This commit is contained in:
ThatGuySam 2023-08-12 16:02:17 -05:00
parent 81340c5e97
commit 361350e5fa

View file

@ -15,6 +15,23 @@
import axios from 'axios'
import { getApiUrl } from '~/helpers/url.js'
import { mswServer } from '~/test/msw/server.js'
const mswEnabled = process.env.NODE_ENV && [ 'development', 'test' ].includes( process.env.NODE_ENV )
// Inspired by https://github.com/wwdrew/examples/blob/react-native/examples/react-native/index.js
if ( mswEnabled ) {
// const { native } = require( '~/test/msw/native' )
// const { mswServer } = await import( '~/test/msw/server' )
// console.log({ mswServer })
mswServer.listen( {
// Fixes issue with MSW capturing POST http://192.168.1.90:19000/symbolicate
onUnhandledRequest: 'bypass',
} )
}
// const defaultFetchMethod = (...args) => console.log(...args) // mock