Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Nov 5, 2025

Currently, Vitest's browser providers (playwright, webdriverio) are not compatible with webcontainer environments. This change introduces detection for webcontainers and and automatically configures the Vitest unit test builder to use the @vitest/browser-preview provider when running within a webcontainer.

This ensures that browser-based unit tests can execute correctly in webcontainer environments, providing a more consistent development experience across different platforms. The user is notified when the webcontainer environment is detected and the preview provider is activated. Dependency checks are also updated to ensure the correct @vitest/browser-preview package is installed when needed.

NOTE: For advanced scenarios, a custom runner config can be used to customize the browser configuration instead of using the builtin --browsers option and its automatic configuration.

…ider

Currently, Vitest's browser providers (playwright, webdriverio) are not compatible with webcontainer environments. This change introduces detection for webcontainers and and automatically configures the Vitest unit test builder to use the `@vitest/browser-preview` provider when running within a webcontainer.

This ensures that browser-based unit tests can execute correctly in webcontainer environments, providing a more consistent development experience across different platforms. The user is notified when the webcontainer environment is detected and the preview provider is activated. Dependency checks are also updated to ensure the correct `@vitest/browser-preview` package is installed when needed.
@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Nov 5, 2025
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Nov 5, 2025
@clydin clydin merged commit 50072cd into angular:main Nov 5, 2025
34 checks passed
@clydin
Copy link
Member Author

clydin commented Nov 5, 2025

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the unit-test/vitest-browser-preview branch November 5, 2025 22:29
@yjaaidi
Copy link
Contributor

yjaaidi commented Nov 6, 2025

❤️
Thank you for this as it closes #31654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants