Skip to content

Commit

Permalink
test(setupServer): add test for not emitting life cycle events on int…
Browse files Browse the repository at this point in the history
…ernal requests
  • Loading branch information
kettanaito committed Jan 8, 2025
1 parent d7d09fb commit ac6da8b
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
// @vitest-environment node
import { setupServer } from 'msw/node'
import {
MSW_REMOTE_SERVER_URL,
MSW_REMOTE_BOUNDARY_ID,
} from '../../../../../src/node/remoteContext'
import { spyOnLifeCycleEvents } from '../../../../support/utils'

const server = setupServer()

beforeAll(() => {
// Mock the environment variables required for the remote interception to work.
vi.stubEnv(MSW_REMOTE_SERVER_URL, 'http://localhost/noop')
vi.stubEnv(MSW_REMOTE_BOUNDARY_ID, 'abc-123')
vi.stubEnv('MSW_REMOTE_SERVER_URL', 'http://localhost/noop')
vi.stubEnv('MSW_REMOTE_BOUNDARY_ID', 'abc-123')

server.listen({
// Enable remote interception to trigger internal requests.
Expand Down

0 comments on commit ac6da8b

Please sign in to comment.