Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Jan 8, 2026

This commit adds a new internal schematic vitest-browser to @schematics/angular which streamlines the setup of Vitest browser testing by handling ng add for the following packages:

  • @vitest/browser-playwright
  • @vitest/browser-webdriverio
  • @vitest/browser-preview

The schematic performs the following actions:

  • Verifies the project is using the @angular/build:unit-test builder.
  • Updates tsconfig.spec.json to include vitest/globals and the respective browser provider package in compilerOptions.types.
  • Installs the requested package along with necessary peer dependencies (e.g., playwright or webdriverio).

Additionally, the ng add command implementation in the CLI has been updated to support passing the package name to built-in schematics, allowing the vitest-browser schematic to know which package was requested.

Closes #31656

@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: @schematics/angular labels Jan 8, 2026
@clydin clydin force-pushed the unit-test/vitest-browser-ng-add branch 2 times, most recently from 3d20591 to 217a11e Compare January 8, 2026 19:32
…iders

This commit adds a new internal schematic `vitest-browser` to `@schematics/angular` which streamlines the setup of Vitest browser testing by handling `ng add` for the following packages:
- `@vitest/browser-playwright`
- `@vitest/browser-webdriverio`
- `@vitest/browser-preview`

The schematic performs the following actions:
- Verifies the project is using the `@angular/build:unit-test` builder.
- Updates `tsconfig.spec.json` to include `vitest/globals` and the respective browser provider package in `compilerOptions.types`.
- Installs the requested package along with necessary peer dependencies (e.g., `playwright` or `webdriverio`).

Additionally, the `ng add` command implementation in the CLI has been updated to support passing the package name to built-in schematics, allowing the `vitest-browser` schematic to know which package was requested.
@clydin clydin force-pushed the unit-test/vitest-browser-ng-add branch from 217a11e to d58dc5c Compare January 8, 2026 19:33
@clydin clydin added the target: minor This PR is targeted for the next minor release label Jan 8, 2026
@clydin clydin marked this pull request as ready for review January 8, 2026 22:16
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @schematics/angular detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unit-test builder with vitest runner should augment types with provider

2 participants