1- import * as path from 'path' ;
1+ import { join } from 'node: path' ;
22import { getGlobalVariable } from '../../utils/env' ;
33import { exec , execAndWaitForOutputToMatch , silentNpm } from '../../utils/process' ;
44import { rimraf } from '../../utils/fs' ;
@@ -14,13 +14,13 @@ export default async function () {
1414 await exec ( process . platform . startsWith ( 'win' ) ? 'where' : 'which' , 'schematics' ) ;
1515
1616 const startCwd = process . cwd ( ) ;
17- const schematicPath = path . join ( startCwd , 'test-schematic' ) ;
17+ const schematicPath = join ( startCwd , 'test-schematic' ) ;
1818
1919 try {
2020 // create blank schematic
2121 await exec ( 'schematics' , 'schematic' , '--name' , 'test-schematic' ) ;
2222
23- process . chdir ( path . join ( startCwd , 'test-schematic' ) ) ;
23+ process . chdir ( join ( startCwd , 'test-schematic' ) ) ;
2424 await execAndWaitForOutputToMatch (
2525 'schematics' ,
2626 [ '.:' , '--list-schematics' ] ,
@@ -29,6 +29,9 @@ export default async function () {
2929 } finally {
3030 // restore path
3131 process . chdir ( startCwd ) ;
32- await rimraf ( schematicPath ) ;
32+ await Promise . all ( [
33+ rimraf ( schematicPath ) ,
34+ silentNpm ( 'uninstall' , '-g' , '@angular-devkit/schematics-cli' ) ,
35+ ] ) ;
3336 }
3437}
0 commit comments