Unverified Commit 7f6b8ac7 authored by Dustin Goodman's avatar Dustin Goodman Committed by GitHub

fix: update with-msw example to function properly for all use cases (#38050)

parent 3ae343fa
if (typeof window === 'undefined') {
const { server } = require('./server')
server.listen()
} else {
const { worker } = require('./browser')
worker.start()
async function initMocks() {
if (typeof window === 'undefined') {
const { server } = await import('./server')
server.listen()
} else {
const { worker } = await import('./browser')
worker.start()
}
}
initMocks()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment