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(cli): parse --browser=<name> correctly #5179

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

AriPerkkio
Copy link
Member

@AriPerkkio AriPerkkio commented Feb 10, 2024

Description

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:.

Copy link

netlify bot commented Feb 10, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 4e6ba96
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/65c9b3b47f1a38000815ebcb

@AriPerkkio AriPerkkio marked this pull request as ready for review February 10, 2024 13:56
@AriPerkkio
Copy link
Member Author

/ecosystem-ci run

@vitest-ecosystem-ci
Copy link

vitest-ecosystem-ci bot commented Feb 10, 2024

📝 Ran ecosystem CI: Open

suite result
nuxt ✅ success
nuxt-test-utils ✅ success
vite ✅ success
vitest-sonar-reporter ✅ success
vitest-github-actions-reporter ✅ success
vitest-browser-simple ✅ success
vitest-coverage-large ✅ success
vitest-reporters-large ✅ success

Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

I wonder how these case are handled now (and also before).

  • --browser=false
  • --browser false
  • --browser some-file.test.ts

Can you include these in tests?

@AriPerkkio
Copy link
Member Author

Added test cases for the --browser=false and --browser false. Not sure how --browser some-file.test.ts could be supported though.

@hi-ogawa
Copy link
Contributor

Just to clarify, I wasn't saying to support something like --browser some-file.test.ts but I was simply wondering the current and previous behaviors.

I would imagine it would be tricky to support that, so it's probably okay to treat it as { name: "some-file.test.ts" } for now?

@AriPerkkio
Copy link
Member Author

Looks like it doesn't work with the latest release either. Let's not do changes related to that for now. I'll revert that test case.

$ vitest --browser app.spec.ts

 DEV  v1.2.2 /x/y/z/browser-simple
      Browser runner started at http://localhost:5173/


⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: [] Browser "app.spec.ts" is not supported by the browser provider "playwright". Supported browsers: firefox, webkit, chromium.

@hi-ogawa
Copy link
Contributor

Maybe revert true/false handling too? It looks like it wasn't supported in the last release.

@sheremet-va
Copy link
Member

Maybe revert true/false handling too? It looks like it wasn't supported in the last release.

It was clearly a bug, and one of the reasons we are making changes to the CLI parsing is to fix those edge cases.

@sheremet-va sheremet-va merged commit 656e210 into vitest-dev:main Feb 12, 2024
17 of 19 checks passed
@AriPerkkio AriPerkkio deleted the fix/browser-cli-option branch February 12, 2024 14:56
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.

None yet

3 participants