-
-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Description
Clear and concise description of the problem
I have two Vitest projects:
- one to test with node,
- another one to test with browsers (firefox and chromium), using the Vitest "browser" mode.
But running the tests in debug mode in VSCode gives me this error:
VSCode can only debug tests running in the "chromium" browser. url.test.ts [browser (firefox)] runs in firefox instead.
Suggested solution
Add an option to use only one project (or a selection of projects)
Alternative
Manually comment Firefox (or the whole "browsers" project) in the Vitest configuration file:
instances: [
{ browser: 'chromium' },
// { browser: 'firefox' },
]Additional context
For reference, this is my vitest.config.js file:
import { playwright } from '@vitest/browser-playwright'
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
projects: [
{
test: {
name: 'node',
environment: 'node',
},
},
{
test: {
name: 'browser',
browser: {
enabled: true,
provider: playwright(),
headless: true,
screenshotFailures: false,
// https://vitest.dev/guide/browser/playwright
instances: [
{ browser: 'chromium' },
{ browser: 'firefox' },
],
},
},
},
],
},
})Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
philsherry and schickling