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): shouldn't open the browser by default #4094

Closed
wants to merge 2 commits into from

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Sep 8, 2023

Description

fix: #4052

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@stackblitz
Copy link

stackblitz bot commented Sep 8, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Sep 8, 2023

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 610ce21
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/64fad49b8d5cb60008fa933b

@@ -57,7 +57,7 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t

;(options as ResolvedConfig).defines = defines

let open: string | boolean | undefined
let open: string | boolean | undefined = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually fix the issue. Server still starts on the same port. What is needed here is to update resolveApiConfig method - it should treat optimizer.web.enabled and optimizer.ssr.enabled like --api flag. They are enabled by default, by the way, so they need to be explicitly set to false for us to not start a server.

This change hovewer should also be included in the fix. We only want to open a server when ui is enabled

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've changed it, I'm not sure I got your point entirely

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly yes, but I got a step further: #4095

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly yes, but I got a step further: #4095

What do you think?

I think good!

@Dunqing Dunqing closed this Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot run tests without opening broken dev server
2 participants