diff --git a/src/node/SetupServerApi.ts b/src/node/SetupServerApi.ts index 56e79ebb1..fcbe696d8 100644 --- a/src/node/SetupServerApi.ts +++ b/src/node/SetupServerApi.ts @@ -13,6 +13,7 @@ import { RemoteRequestHandler } from '~/core/handlers/RemoteRequestHandler' import { shouldBypassRequest } from '~/core/utils/internal/requestUtils' import { getRemoteContextFromEnvironment } from './remoteContext' import { LifeCycleEventsMap } from '~/core/sharedOptions' +import { devUtils } from '~/core/utils/internal/devUtils' const handlersStorage = new AsyncLocalStorage() @@ -143,9 +144,9 @@ export class SetupServerApi ) }, () => { - // eslint-disable-next-line no-console - console.error( - `Failed to connect to a remote server at "${remoteContext.serverUrl}"`, + devUtils.error( + 'Failed to enable remote mode: could not connect to the remote server at "%s"', + remoteContext.serverUrl, ) }, ) diff --git a/test/node/msw-api/setup-remote-server/life-cycle-event-forwarding.node.test.ts b/test/node/msw-api/setup-remote-server/life-cycle-event-forwarding.node.test.ts index df6cbd43a..cd14fe332 100644 --- a/test/node/msw-api/setup-remote-server/life-cycle-event-forwarding.node.test.ts +++ b/test/node/msw-api/setup-remote-server/life-cycle-event-forwarding.node.test.ts @@ -89,7 +89,7 @@ it( }), ) - await using testApp = await spawnTestApp(require.resolve('../use.app.js')) + await using testApp = await spawnTestApp(require.resolve('./use.app.js')) const { listener, waitForRequestId } = spyOnLifeCycleEvents(remote) const response = await fetch(new URL('/resource', testApp.url)) @@ -117,7 +117,7 @@ it( it( 'emits correct events for the request handled in the remote process', remote.boundary(async () => { - await using testApp = await spawnTestApp(require.resolve('../use.app.js')) + await using testApp = await spawnTestApp(require.resolve('./use.app.js')) const { listener, waitForRequestId } = spyOnLifeCycleEvents(remote) const response = await fetch(new URL('/resource', testApp.url)) @@ -143,7 +143,7 @@ it( it( 'emits correct events for the request unhandled by either parties', remote.boundary(async () => { - await using testApp = await spawnTestApp(require.resolve('../use.app.js')) + await using testApp = await spawnTestApp(require.resolve('./use.app.js')) const { listener, waitForRequestId } = spyOnLifeCycleEvents(remote) const resourceUrl = httpServer.http.url('/greeting')