Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@schematics/schematics): replaced removed
runner.runSchematic
w…
…ith `runner.runSchematicAsync` Deprecated `runSchematic` has been removed in version 10, `runSchematicAsync` should be used instead. Closes #18062
- Loading branch information
1 parent
d24a239
commit c402c31
Showing
7 changed files
with
100 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as path from 'path'; | ||
import { getGlobalVariable } from '../../utils/env'; | ||
import { exec, silentNpm } from '../../utils/process'; | ||
import { rimraf } from '../../utils/fs'; | ||
|
||
export default async function () { | ||
// setup | ||
const argv = getGlobalVariable('argv'); | ||
if (argv.noglobal) { | ||
return; | ||
} | ||
|
||
await silentNpm( | ||
'install', | ||
'-g', | ||
'@angular-devkit/schematics-cli', | ||
'--registry=http://localhost:4873', | ||
); | ||
await exec(process.platform.startsWith('win') ? 'where' : 'which', 'schematics'); | ||
|
||
const startCwd = process.cwd(); | ||
const schematicPath = path.join(startCwd, 'test-schematic'); | ||
|
||
try { | ||
// create schematic | ||
await exec('schematics', 'blank', '--name', 'test-schematic'); | ||
|
||
process.chdir(schematicPath); | ||
|
||
await silentNpm('install'); | ||
await silentNpm('test'); | ||
} finally { | ||
// restore path | ||
process.chdir(startCwd); | ||
await rimraf(schematicPath); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
tests/legacy-cli/e2e/tests/schematics_cli/schematic-test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as path from 'path'; | ||
import { getGlobalVariable } from '../../utils/env'; | ||
import { exec, silentNpm } from '../../utils/process'; | ||
import { rimraf } from '../../utils/fs'; | ||
|
||
export default async function () { | ||
// setup | ||
const argv = getGlobalVariable('argv'); | ||
if (argv.noglobal) { | ||
return; | ||
} | ||
|
||
await silentNpm( | ||
'install', | ||
'-g', | ||
'@angular-devkit/schematics-cli', | ||
'--registry=http://localhost:4873', | ||
); | ||
await exec(process.platform.startsWith('win') ? 'where' : 'which', 'schematics'); | ||
|
||
const startCwd = process.cwd(); | ||
const schematicPath = path.join(startCwd, 'test-schematic'); | ||
|
||
try { | ||
// create schematic | ||
await exec('schematics', 'schematic', '--name', 'test-schematic'); | ||
|
||
process.chdir(schematicPath); | ||
|
||
await silentNpm('install'); | ||
await silentNpm('test'); | ||
} finally { | ||
// restore path | ||
process.chdir(startCwd); | ||
await rimraf(schematicPath); | ||
} | ||
} |