Skip to content

Commit

Permalink
fix(@angular-devkit/schematics): deprecate synchronous testing methods
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clydin authored and Keen Yee Liau committed May 15, 2019
1 parent fd71edc commit eddb2e0
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export class SchematicTestRunner {
.pipe(map(tree => new UnitTestTree(tree)));
}

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

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

0 comments on commit eddb2e0

Please sign in to comment.