File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import assert from 'node:assert/strict' ;
22import { applyVitestBuilder } from '../../utils/vitest' ;
33import { ng } from '../../utils/process' ;
4- import { installPackage } from '../../utils/packages' ;
54import { writeFile } from '../../utils/fs' ;
65import { updateJsonFile } from '../../utils/project' ;
76
87export default async function ( ) : Promise < void > {
9- await applyVitestBuilder ( ) ;
10- await installPackage ( 'webdriverio@9' ) ;
11- await installPackage ( '@vitest/browser-webdriverio@4' ) ;
8+ await applyVitestBuilder ( {
9+ webdriver : true ,
10+ } ) ;
1211
1312 await ng ( 'generate' , 'component' , 'my-comp' ) ;
1413
Original file line number Diff line number Diff line change 1- import { installPackage } from './packages' ;
1+ import { installWorkspacePackages } from './packages' ;
22import { updateJsonFile } from './project' ;
33
44/** Updates the `test` builder in the current workspace to use Vitest. */
5- export async function applyVitestBuilder ( ) : Promise < void > {
5+ export async function applyVitestBuilder ( options ?: { webdriver ?: boolean } ) : Promise < void > {
66 // These deps matches the deps in `@schematics/angular`
7- await installPackage ( 'vitest@^4.0.8' ) ;
8- await installPackage ( 'jsdom@^27.1.0' ) ;
7+ await updateJsonFile ( 'package.json' , ( json ) => {
8+ json . devDependencies [ 'vitest' ] = '^4.0.8' ;
9+ json . devDependencies [ 'jsdom' ] = '^27.1.0' ;
10+
11+ if ( options ?. webdriver ) {
12+ json . devDependencies [ 'webdriverio' ] = '^9.0.0' ;
13+ json . devDependencies [ '@vitest/browser-webdriverio' ] = '^4.0.8' ;
14+ }
15+ } ) ;
16+
17+ await installWorkspacePackages ( ) ;
918
1019 await updateJsonFile ( 'angular.json' , ( json ) => {
1120 const projects = Object . values ( json [ 'projects' ] ) ;
You can’t perform that action at this time.
0 commit comments