Skip to content

Commit 01d634f

Browse files
committed
chore(deps): update angular schematics
1 parent 58e4e41 commit 01d634f

File tree

3 files changed

+128
-194
lines changed

3 files changed

+128
-194
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"typescript": "4.9.4"
4747
},
4848
"dependencies": {
49-
"@angular-devkit/schematics": "12.2.16",
50-
"@schematics/angular": "12.2.16",
49+
"@angular-devkit/schematics": "^15.1.2",
50+
"@schematics/angular": "^15.1.2",
5151
"@types/jest": "26.0.24",
5252
"cors": "2.8.5",
5353
"jest": "27.5.1",

schematics/install/index.test.ts

Lines changed: 81 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ describe('Schematic Tests Nest Add', () => {
3333
rootModuleClassName: 'AppModule'
3434
};
3535

36-
const tree = await runner
37-
.runSchematicAsync('nest-add', options, nestTree)
38-
.toPromise();
36+
const tree = await runner.runSchematic('nest-add', options, nestTree);
3937
const files: string[] = tree.files;
4038
expect(files).toEqual([
4139
'/.eslintrc.js',
@@ -72,10 +70,7 @@ describe('Schematic Tests Nest Add', () => {
7270
rootModuleClassName: 'AppModule'
7371
};
7472

75-
const tree = await runner
76-
.runSchematicAsync('nest-add', options, nestTree)
77-
.toPromise();
78-
73+
const tree = await runner.runSchematic('nest-add', options, nestTree);
7974
const fileContent = getFileContent(tree, '/nest-cli.json');
8075
expect(fileContent).toContain(`"sourceRoot": "src"`);
8176
});
@@ -89,10 +84,7 @@ describe('Schematic Tests Nest Add', () => {
8984
rootModuleClassName: 'AppModule'
9085
};
9186

92-
const tree = await runner
93-
.runSchematicAsync('nest-add', options, nestTree)
94-
.toPromise();
95-
87+
const tree = await runner.runSchematic('nest-add', options, nestTree);
9688
const fileContent = getFileContent(tree, '/src/main.azure.ts');
9789

9890
expect(fileContent).toContain(
@@ -109,10 +101,7 @@ describe('Schematic Tests Nest Add', () => {
109101
rootModuleClassName: 'AppModule'
110102
};
111103

112-
const tree = await runner
113-
.runSchematicAsync('nest-add', options, nestTree)
114-
.toPromise();
115-
104+
const tree = await runner.runSchematic('nest-add', options, nestTree);
116105
const fileContent = getFileContent(tree, '/main/index.ts');
117106

118107
expect(fileContent).toContain(
@@ -129,10 +118,7 @@ describe('Schematic Tests Nest Add', () => {
129118
rootModuleClassName: 'AppModule'
130119
};
131120

132-
const tree = await runner
133-
.runSchematicAsync('nest-add', options, nestTree)
134-
.toPromise();
135-
121+
const tree = await runner.runSchematic('nest-add', options, nestTree);
136122
const fileContent = tree.get('webpack.config.js');
137123

138124
expect(fileContent).toBeNull();
@@ -149,21 +135,16 @@ describe('Schematic Tests Nest Add', () => {
149135
sourceRoot: `apps/${projectName}/src`
150136
};
151137

152-
await runner
153-
.runExternalSchematicAsync(
154-
'@nestjs/schematics',
155-
'sub-app',
156-
{
157-
name: projectName
158-
},
159-
nestTree
160-
)
161-
.toPromise();
162-
163-
const tree = await runner
164-
.runSchematicAsync('nest-add', options, nestTree)
165-
.toPromise();
138+
await runner.runExternalSchematic(
139+
'@nestjs/schematics',
140+
'sub-app',
141+
{
142+
name: projectName
143+
},
144+
nestTree
145+
);
166146

147+
const tree = await runner.runSchematic('nest-add', options, nestTree);
167148
const files: string[] = tree.files;
168149
expect(files).toEqual([
169150
'/.eslintrc.js',
@@ -192,8 +173,8 @@ describe('Schematic Tests Nest Add', () => {
192173
`/apps/${projectName}/src/${projectName}.module.ts`,
193174
`/apps/${projectName}/src/${projectName}.service.ts`,
194175
`/apps/${projectName}/src/main.azure.ts`,
195-
`/apps/${projectName}/test/app.e2e-spec.ts`,
196176
`/apps/${projectName}/test/jest-e2e.json`,
177+
`/apps/${projectName}/test/app.e2e-spec.ts`,
197178
`/${projectName}/function.json`,
198179
`/${projectName}/index.ts`,
199180
`/${projectName}/sample.dat`,
@@ -209,20 +190,16 @@ describe('Schematic Tests Nest Add', () => {
209190
sourceRoot: `apps/${projectName}/src`
210191
};
211192

212-
await runner
213-
.runExternalSchematicAsync(
214-
'@nestjs/schematics',
215-
'sub-app',
216-
{
217-
name: projectName
218-
},
219-
nestTree
220-
)
221-
.toPromise();
222-
223-
const tree = await runner
224-
.runSchematicAsync('nest-add', options, nestTree)
225-
.toPromise();
193+
await runner.runExternalSchematic(
194+
'@nestjs/schematics',
195+
'sub-app',
196+
{
197+
name: projectName
198+
},
199+
nestTree
200+
);
201+
202+
const tree = await runner.runSchematic('nest-add', options, nestTree);
226203
const fileContent = getFileContent(tree, '/nest-cli.json');
227204
const parsedFile = JSON.parse(fileContent);
228205
expect(parsedFile.projects[projectName].sourceRoot).toEqual(
@@ -238,20 +215,16 @@ describe('Schematic Tests Nest Add', () => {
238215
sourceRoot: `apps/${projectName}/src`
239216
};
240217

241-
await runner
242-
.runExternalSchematicAsync(
243-
'@nestjs/schematics',
244-
'sub-app',
245-
{
246-
name: projectName
247-
},
248-
nestTree
249-
)
250-
.toPromise();
251-
252-
const tree = await runner
253-
.runSchematicAsync('nest-add', options, nestTree)
254-
.toPromise();
218+
await runner.runExternalSchematic(
219+
'@nestjs/schematics',
220+
'sub-app',
221+
{
222+
name: projectName
223+
},
224+
nestTree
225+
);
226+
227+
const tree = await runner.runSchematic('nest-add', options, nestTree);
255228
const fileContent = getFileContent(
256229
tree,
257230
`/apps/${projectName}/src/main.azure.ts`
@@ -270,20 +243,16 @@ describe('Schematic Tests Nest Add', () => {
270243
sourceRoot: `apps/${projectName}/src`
271244
};
272245

273-
await runner
274-
.runExternalSchematicAsync(
275-
'@nestjs/schematics',
276-
'sub-app',
277-
{
278-
name: projectName
279-
},
280-
nestTree
281-
)
282-
.toPromise();
283-
284-
const tree = await runner
285-
.runSchematicAsync('nest-add', options, nestTree)
286-
.toPromise();
246+
await runner.runExternalSchematic(
247+
'@nestjs/schematics',
248+
'sub-app',
249+
{
250+
name: projectName
251+
},
252+
nestTree
253+
);
254+
255+
const tree = await runner.runSchematic('nest-add', options, nestTree);
287256
const fileContent = getFileContent(tree, `/${projectName}/index.ts`);
288257

289258
expect(fileContent).toContain(
@@ -300,19 +269,15 @@ describe('Schematic Tests Nest Add', () => {
300269
sourceRoot: `apps/${projectName}/src`
301270
};
302271

303-
await runner
304-
.runExternalSchematicAsync(
305-
'@nestjs/schematics',
306-
'sub-app',
307-
{
308-
name: projectName
309-
},
310-
nestTree
311-
)
312-
.toPromise();
313-
const tree = await runner
314-
.runSchematicAsync('nest-add', options, nestTree)
315-
.toPromise();
272+
await runner.runExternalSchematic(
273+
'@nestjs/schematics',
274+
'sub-app',
275+
{
276+
name: projectName
277+
},
278+
nestTree
279+
);
280+
const tree = await runner.runSchematic('nest-add', options, nestTree);
316281

317282
const fileContent = getFileContent(
318283
tree,
@@ -329,19 +294,15 @@ describe('Schematic Tests Nest Add', () => {
329294
sourceRoot: `apps/${projectName}/src`
330295
};
331296

332-
await runner
333-
.runExternalSchematicAsync(
334-
'@nestjs/schematics',
335-
'sub-app',
336-
{
337-
name: projectName
338-
},
339-
nestTree
340-
)
341-
.toPromise();
342-
const tree = await runner
343-
.runSchematicAsync('nest-add', options, nestTree)
344-
.toPromise();
297+
await runner.runExternalSchematic(
298+
'@nestjs/schematics',
299+
'sub-app',
300+
{
301+
name: projectName
302+
},
303+
nestTree
304+
);
305+
const tree = await runner.runSchematic('nest-add', options, nestTree);
345306

346307
const fileContent = getFileContent(tree, 'nest-cli.json');
347308
const parsedFile = JSON.parse(fileContent);
@@ -362,19 +323,15 @@ describe('Schematic Tests Nest Add', () => {
362323
sourceRoot: `apps/${projectName}/src`
363324
};
364325

365-
await runner
366-
.runExternalSchematicAsync(
367-
'@nestjs/schematics',
368-
'sub-app',
369-
{
370-
name: projectName
371-
},
372-
nestTree
373-
)
374-
.toPromise();
375-
const tree = await runner
376-
.runSchematicAsync('nest-add', options, nestTree)
377-
.toPromise();
326+
await runner.runExternalSchematic(
327+
'@nestjs/schematics',
328+
'sub-app',
329+
{
330+
name: projectName
331+
},
332+
nestTree
333+
);
334+
const tree = await runner.runSchematic('nest-add', options, nestTree);
378335

379336
const fileContent = getFileContent(tree, `${projectName}/function.json`);
380337
const parsedFile = JSON.parse(fileContent);
@@ -386,16 +343,14 @@ describe('Schematic Tests Nest Add', () => {
386343
runner: SchematicTestRunner,
387344
tree?: Tree
388345
): Promise<UnitTestTree> {
389-
return await runner
390-
.runExternalSchematicAsync(
391-
'@nestjs/schematics',
392-
'application',
393-
{
394-
name: 'newproject',
395-
directory: '.'
396-
},
397-
tree
398-
)
399-
.toPromise();
346+
return await runner.runExternalSchematic(
347+
'@nestjs/schematics',
348+
'application',
349+
{
350+
name: 'newproject',
351+
directory: '.'
352+
},
353+
tree
354+
);
400355
}
401356
});

0 commit comments

Comments
 (0)