-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runnerp2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
Clear and concise description of the problem
We've identified several pain points with Browser Mode:
- Users have to manually add
@vitest/browser/providers/...types to tsconfig manually. - It is not possible to opt-out of certain features like
locatorsorjest-dom; we want a more simple setup like Karma or Web Test Runner
Suggested solution
These are some possible proposals:
Support browser providers via an export:
import { webdriverio } from '@vitest/browser-webdriverio'
// or
import { playwright } from '@vitest/browser-playwright'
export default defineConfig({
plugins: [
webdriverio({ ...customOptions }),
// or
playwright({ ...customOptions }),
],
})browser-webdriverio/browser-playwright packages would also augment Vite config types to allow WebdriverIO/Playwright options in instances and require specific browser names, so users don't need to augment TypeScript types manually.
These packages will also have playwright/webdriverio in dependencies, so users don't need to install them manually.
New option browser.apis:
export default defineConfig({
test: {
browser: {
apis: ['expect.element', 'locators', 'jest-dom'],
},
},
})Users can opt-out of certain APIs to avoid the overhead of loading them.
Alternative
No response
Additional context
No response
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runnerp2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)