Skip to content

Commit 1a80072

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 816d23b commit 1a80072

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

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

88+
/**
89+
* @deprecated Use `runSchematicAsync`. All schematics can potentially be async. This
90+
* synchronous variant will fail if the schematic, any of its rules, or any schematics
91+
* it calls are async.
92+
*/
8893
runSchematic<SchematicSchemaT>(
8994
schematicName: string,
9095
opts?: SchematicSchemaT,
@@ -126,6 +131,11 @@ export class SchematicTestRunner {
126131
.pipe(map(tree => new UnitTestTree(tree)));
127132
}
128133

134+
/**
135+
* @deprecated Use `runExternalSchematicAsync`. All schematics can potentially be async. This
136+
* synchronous variant will fail if the schematic, any of its rules, or any schematics
137+
* it calls are async.
138+
*/
129139
runExternalSchematic<SchematicSchemaT>(
130140
collectionName: string,
131141
schematicName: string,

0 commit comments

Comments
 (0)