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

[v3] Browser Mode: Error when running npx vitest --browser.headless #7300

Closed
6 tasks done
marcomuser opened this issue Jan 20, 2025 · 0 comments · Fixed by #7311
Closed
6 tasks done

[v3] Browser Mode: Error when running npx vitest --browser.headless #7300

marcomuser opened this issue Jan 20, 2025 · 0 comments · Fixed by #7311
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@marcomuser
Copy link
Contributor

marcomuser commented Jan 20, 2025

Describe the bug

When I want to run vitest in headless mode via the CLI npx vitest --browser.headless I get the following error: Error: Vitest Browser Mode requires "browser.name" (deprecated) or "browser.instances" options, none were set..

This used to work with v2 and the deprecated browser.name in my workspace config.

Reproduction

I have a vitest workspace defined like this:

export default defineWorkspace([
  {
    test: {
      include: [
        "packages/*/test/unit/**/*.test.{ts,tsx}",
        "packages/*/test/types/**/*.test-d.{ts,tsx}",
      ],
      name: "node",
      environment: "node",
      typecheck: {
        enabled: true,
        tsconfig: "./tsconfig.json",
      },
    },
  },
  {
    test: {
      include: ["packages/*/test/browser/**/*.test.{ts,tsx}"],
      name: "browser",
      browser: {
        enabled: true,
        provider: "playwright",
        instances: [
          {
            browser: "chromium",
          },
        ],
      },
    },
  },
]);

Run npx vitest --browser.headless

System Info

Used Package Manager

npm

Validations

@sheremet-va sheremet-va added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Jan 20, 2025
@sheremet-va sheremet-va moved this to Approved in Team Board Jan 20, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
Archived in project
2 participants