diff --git a/packages/vitest/src/node/plugins/index.ts b/packages/vitest/src/node/plugins/index.ts index fb82f7884b3e..fa2d50e7f3df 100644 --- a/packages/vitest/src/node/plugins/index.ts +++ b/packages/vitest/src/node/plugins/index.ts @@ -98,6 +98,7 @@ export async function VitestPlugin( ...testConfig.api, open, hmr: false, + ws: testConfig.api?.middlewareMode ? false : undefined, preTransformRequests: false, fs: { allow: resolveFsAllow(getRoot(), testConfig.config), diff --git a/packages/vitest/src/node/plugins/workspace.ts b/packages/vitest/src/node/plugins/workspace.ts index 1c5ff4878835..6e4af78efddc 100644 --- a/packages/vitest/src/node/plugins/workspace.ts +++ b/packages/vitest/src/node/plugins/workspace.ts @@ -85,6 +85,7 @@ export function WorkspaceVitestPlugin( watch: null, open: false, hmr: false, + ws: false, preTransformRequests: false, middlewareMode: true, fs: {