1
- import * as path from 'path' ;
1
+ import { join } from 'node: path' ;
2
2
import { getGlobalVariable } from '../../utils/env' ;
3
3
import { exec , execAndWaitForOutputToMatch , silentNpm } from '../../utils/process' ;
4
4
import { rimraf } from '../../utils/fs' ;
@@ -14,13 +14,13 @@ export default async function () {
14
14
await exec ( process . platform . startsWith ( 'win' ) ? 'where' : 'which' , 'schematics' ) ;
15
15
16
16
const startCwd = process . cwd ( ) ;
17
- const schematicPath = path . join ( startCwd , 'test-schematic' ) ;
17
+ const schematicPath = join ( startCwd , 'test-schematic' ) ;
18
18
19
19
try {
20
20
// create blank schematic
21
21
await exec ( 'schematics' , 'schematic' , '--name' , 'test-schematic' ) ;
22
22
23
- process . chdir ( path . join ( startCwd , 'test-schematic' ) ) ;
23
+ process . chdir ( join ( startCwd , 'test-schematic' ) ) ;
24
24
await execAndWaitForOutputToMatch (
25
25
'schematics' ,
26
26
[ '.:' , '--list-schematics' ] ,
@@ -29,6 +29,9 @@ export default async function () {
29
29
} finally {
30
30
// restore path
31
31
process . chdir ( startCwd ) ;
32
- await rimraf ( schematicPath ) ;
32
+ await Promise . all ( [
33
+ rimraf ( schematicPath ) ,
34
+ silentNpm ( 'uninstall' , '-g' , '@angular-devkit/schematics-cli' ) ,
35
+ ] ) ;
33
36
}
34
37
}
0 commit comments