Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vitest): don't start the server when optimizer is enabled #4095

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: cleanup
  • Loading branch information
sheremet-va committed Sep 8, 2023
commit 363548654bd774bda10d187efdf1129375428311
3 changes: 3 additions & 0 deletions packages/vitest/src/integrations/browser/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export async function createBrowserServer(project: WorkspaceProject, configFile:
port: defaultBrowserPort,
}

// browser never runs in middleware mode
server.middlewareMode = false

config.server = server
config.server.fs ??= {}
config.server.fs.allow = config.server.fs.allow || []
Expand Down
5 changes: 1 addition & 4 deletions packages/vitest/src/node/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ export async function initializeProject(workspacePath: string | number, ctx: Vit
],
}

const server = await createServer(config)

if (ctx.config.api?.port)
await server.listen()
await createServer(config)

return project
}
Expand Down