Skip to content

Commit f600bbc

Browse files
committed
refactor(@angular-devkit/schematics): remove deprecated runExternalSchematicAsync and runSchematicAsync
BREAKING CHANGE: deprecated `runExternalSchematicAsync` and `runSchematicAsync` methods have been removed in favor of `runExternalSchematic` and `runSchematic`.
1 parent 17ffedc commit f600bbc

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

goldens/public-api/angular_devkit/schematics/testing/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ export class SchematicTestRunner {
2424
registerCollection(collectionName: string, collectionPath: string): void;
2525
// (undocumented)
2626
runExternalSchematic<SchematicSchemaT extends object>(collectionName: string, schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Promise<UnitTestTree>;
27-
// @deprecated (undocumented)
28-
runExternalSchematicAsync<SchematicSchemaT extends object>(collectionName: string, schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Observable<UnitTestTree>;
2927
// (undocumented)
3028
runSchematic<SchematicSchemaT extends object>(schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Promise<UnitTestTree>;
31-
// @deprecated (undocumented)
32-
runSchematicAsync<SchematicSchemaT extends object>(schematicName: string, opts?: SchematicSchemaT, tree?: Tree_2): Observable<UnitTestTree>;
3329
// (undocumented)
3430
get tasks(): TaskConfiguration[];
3531
}

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

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import { logging, schema } from '@angular-devkit/core';
10-
import { Observable, from, lastValueFrom, of as observableOf } from 'rxjs';
10+
import { Observable, lastValueFrom, of as observableOf } from 'rxjs';
1111
import {
1212
Collection,
1313
DelegateTree,
@@ -48,7 +48,10 @@ export class SchematicTestRunner {
4848
private _collection: Collection<{}, {}>;
4949
private _logger: logging.Logger;
5050

51-
constructor(private _collectionName: string, collectionPath: string) {
51+
constructor(
52+
private _collectionName: string,
53+
collectionPath: string,
54+
) {
5255
this._engineHost.registerCollection(_collectionName, collectionPath);
5356
this._logger = new logging.Logger('test');
5457

@@ -91,17 +94,6 @@ export class SchematicTestRunner {
9194
return new UnitTestTree(newTree);
9295
}
9396

94-
/**
95-
* @deprecated since version 15.1. Use `runSchematic` instead.
96-
*/
97-
runSchematicAsync<SchematicSchemaT extends object>(
98-
schematicName: string,
99-
opts?: SchematicSchemaT,
100-
tree?: Tree,
101-
): Observable<UnitTestTree> {
102-
return from(this.runSchematic(schematicName, opts, tree));
103-
}
104-
10597
async runExternalSchematic<SchematicSchemaT extends object>(
10698
collectionName: string,
10799
schematicName: string,
@@ -118,18 +110,6 @@ export class SchematicTestRunner {
118110
return new UnitTestTree(newTree);
119111
}
120112

121-
/**
122-
* @deprecated since version 15.1. Use `runExternalSchematic` instead.
123-
*/
124-
runExternalSchematicAsync<SchematicSchemaT extends object>(
125-
collectionName: string,
126-
schematicName: string,
127-
opts?: SchematicSchemaT,
128-
tree?: Tree,
129-
): Observable<UnitTestTree> {
130-
return from(this.runExternalSchematic(collectionName, schematicName, opts, tree));
131-
}
132-
133113
callRule(rule: Rule, tree: Tree, parentContext?: Partial<SchematicContext>): Observable<Tree> {
134114
const context = this._engine.createContext({} as Schematic<{}, {}>, parentContext);
135115

0 commit comments

Comments
 (0)