Skip to content

Commit eb488f2

Browse files
committed
fix(@angular-devkit/schematics): deprecate synchronous testing methods
All schematics can potentially be async. The synchronous test method variants (`runSchematic`/`runExternalSchematic`) will fail if the schematic, any of its rules, or any schematic it calls are async.
1 parent 5770762 commit eb488f2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/angular_devkit/schematics/testing/schematic-test-runner.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ export class SchematicTestRunner {
8585
.pipe(map(tree => new UnitTestTree(tree)));
8686
}
8787

88+
/**
89+
* @deprecated Since v8.0.0 - Use {@link SchematicTestRunner.runSchematicAsync} instead.
90+
* All schematics can potentially be async.
91+
* This synchronous variant will fail if the schematic, any of its rules, or any schematics
92+
* it calls are async.
93+
*/
8894
runSchematic<SchematicSchemaT>(
8995
schematicName: string,
9096
opts?: SchematicSchemaT,
@@ -126,6 +132,12 @@ export class SchematicTestRunner {
126132
.pipe(map(tree => new UnitTestTree(tree)));
127133
}
128134

135+
/**
136+
* @deprecated Since v8.0.0 - Use {@link SchematicTestRunner.runExternalSchematicAsync} instead.
137+
* All schematics can potentially be async.
138+
* This synchronous variant will fail if the schematic, any of its rules, or any schematics
139+
* it calls are async.
140+
*/
129141
runExternalSchematic<SchematicSchemaT>(
130142
collectionName: string,
131143
schematicName: string,

0 commit comments

Comments
 (0)