Skip to content

Browser configuration not being respected from workspace config #6911

@luc122c

Description

@luc122c

Describe the bug

In my local testing environment, my browser tests didn't seem to be using the correct browser driver. After creating a minimal reproduction, I came up against the following error:

Error: You've enabled headless mode for "preview" provider but it doesn't support it. Use "playwright" or "webdriverio" instead: https://vitest.dev/guide/browser/#configuration

This is despite the provider being set to 'webdriverio' in the workspace configuration. Tests in the node environment still run fine, but it is causing issues with some of my browser-specific tests.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-2psm5o?file=vitest.workspace.ts

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitest/browser: ^2.1.5 => 2.1.5 
    @vitest/ui: latest => 2.1.5 
    vite: latest => 5.4.11 
    vitest: ^2.1.5 => 2.1.5

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions