Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 508373f

Browse files
committed
test: update schematics
1 parent 6b74399 commit 508373f

File tree

6 files changed

+22
-32
lines changed

6 files changed

+22
-32
lines changed

libs/cdk/schematics/src/migrations/update-1.0.0-beta.1/index.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,6 @@ describe('cdk migration 1.0.0-beta.1', () => {
432432

433433
tree.create(filePath, fileInput);
434434

435-
return runner
436-
.runSchematicAsync(`update-1.0.0-beta.1`, {}, tree)
437-
.toPromise();
435+
return runner.runSchematic(`update-1.0.0-beta.1`, {}, tree);
438436
}
439437
});

libs/state/schematics/src/migrations/update-1.4.7/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ describe('state migration update-1.4.7', () => {
111111

112112
tree.create(filePath, fileInput);
113113

114-
return runner.runSchematicAsync(`update-1.4.7`, {}, tree).toPromise();
114+
return runner.runSchematic(`update-1.4.7`, {}, tree);
115115
}
116116
});

libs/template/schematics/src/commands/ng-add/index.spec.ts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import {
55
import { join } from 'path';
66
import { readJsonInTree } from '../../utils/read-json-in-tree';
77

8-
9-
108
const collectionPath = join(__dirname, '../../../collection.json');
119

1210
const workspaceOptions = {
@@ -28,28 +26,26 @@ describe('ng-add schematic', () => {
2826
'@rx-angular/schematics',
2927
collectionPath
3028
);
31-
appTree = await schematicRunner
32-
.runExternalSchematicAsync(
33-
'@schematics/angular',
34-
'workspace',
35-
workspaceOptions
36-
)
37-
.toPromise();
38-
39-
appTree = await schematicRunner
40-
.runExternalSchematicAsync(
41-
'@schematics/angular',
42-
'application',
43-
defaultAppOptions,
44-
appTree
45-
)
46-
.toPromise();
29+
appTree = await schematicRunner.runExternalSchematic(
30+
'@schematics/angular',
31+
'workspace',
32+
workspaceOptions
33+
);
34+
35+
appTree = await schematicRunner.runExternalSchematic(
36+
'@schematics/angular',
37+
'application',
38+
defaultAppOptions,
39+
appTree
40+
);
4741
});
4842

4943
it('should add proper package to dependencies', async () => {
50-
const tree = await schematicRunner
51-
.runSchematicAsync('ng-add', undefined, appTree)
52-
.toPromise();
44+
const tree = await schematicRunner.runSchematic(
45+
'ng-add',
46+
undefined,
47+
appTree
48+
);
5349

5450
const packageJson = readJsonInTree(tree, 'package.json');
5551

libs/template/schematics/src/migrations/introduce-rxfor-stable/index.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ describe('Template Migration introduce-rxfor-stable', () => {
4848

4949
tree.create(filePath, fileInput);
5050

51-
return runner
52-
.runSchematicAsync(`introduce-rxfor-stable`, {}, tree)
53-
.toPromise();
51+
return runner.runSchematic(`introduce-rxfor-stable`, {}, tree);
5452
}
5553
});

libs/template/schematics/src/migrations/introduce-rxif-stable/index.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ describe('Template Migration introduce-rxif-stable', () => {
4848

4949
tree.create(filePath, fileInput);
5050

51-
return runner
52-
.runSchematicAsync(`introduce-rxif-stable`, {}, tree)
53-
.toPromise();
51+
return runner.runSchematic(`introduce-rxif-stable`, {}, tree);
5452
}
5553
});

libs/template/schematics/src/migrations/update-1.0.0-beta.30/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@ describe('Template Migration 1.0.0-beta.30', () => {
155155

156156
tree.create(filePath, fileInput);
157157

158-
return runner.runSchematicAsync(`update-1.0.0-beta.30`, {}, tree).toPromise();
158+
return runner.runSchematic(`update-1.0.0-beta.30`, {}, tree);
159159
}
160160
});

0 commit comments

Comments
 (0)