Skip to content

Commit 85a9e21

Browse files
committed
build: update to latest Angular and fix test failures
Updates to the latest version of Angular and fixes some tests that were broken by the CLI switching to generating standalone apps by default.
1 parent cc3428e commit 85a9e21

File tree

12 files changed

+347
-282
lines changed

12 files changed

+347
-282
lines changed

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
},
5858
"version": "17.0.0-next.5",
5959
"dependencies": {
60-
"@angular/animations": "^17.0.0-next.4",
61-
"@angular/common": "^17.0.0-next.4",
62-
"@angular/compiler": "^17.0.0-next.4",
63-
"@angular/core": "^17.0.0-next.4",
64-
"@angular/forms": "^17.0.0-next.4",
65-
"@angular/platform-browser": "^17.0.0-next.4",
60+
"@angular/animations": "^17.0.0-next.6",
61+
"@angular/common": "^17.0.0-next.6",
62+
"@angular/compiler": "^17.0.0-next.6",
63+
"@angular/core": "^17.0.0-next.6",
64+
"@angular/forms": "^17.0.0-next.6",
65+
"@angular/platform-browser": "^17.0.0-next.6",
6666
"@types/google.maps": "^3.52.4",
6767
"@types/youtube": "^0.0.46",
6868
"rxjs": "^6.6.7",
@@ -71,18 +71,18 @@
7171
"zone.js": "~0.13.0"
7272
},
7373
"devDependencies": {
74-
"@angular-devkit/build-angular": "^17.0.0-next.4",
75-
"@angular-devkit/core": "^17.0.0-next.4",
76-
"@angular-devkit/schematics": "^17.0.0-next.4",
74+
"@angular-devkit/build-angular": "^17.0.0-next.6",
75+
"@angular-devkit/core": "^17.0.0-next.6",
76+
"@angular-devkit/schematics": "^17.0.0-next.6",
7777
"@angular/bazel": "https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469",
7878
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#22a9a75114d5e80907054f01b9fa360972de1c05",
79-
"@angular/cli": "^17.0.0-next.4",
80-
"@angular/compiler-cli": "^17.0.0-next.4",
81-
"@angular/localize": "^17.0.0-next.4",
79+
"@angular/cli": "^17.0.0-next.6",
80+
"@angular/compiler-cli": "^17.0.0-next.6",
81+
"@angular/localize": "^17.0.0-next.6",
8282
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#2c4d983ef0f1f000a8554b3b7fbf7f1061c877d3",
83-
"@angular/platform-browser-dynamic": "^17.0.0-next.4",
84-
"@angular/platform-server": "^17.0.0-next.4",
85-
"@angular/router": "^17.0.0-next.4",
83+
"@angular/platform-browser-dynamic": "^17.0.0-next.6",
84+
"@angular/platform-server": "^17.0.0-next.6",
85+
"@angular/router": "^17.0.0-next.6",
8686
"@babel/core": "^7.16.12",
8787
"@babel/helper-explode-assignable-expression": "^7.18.6",
8888
"@babel/helper-string-parser": "^7.22.5",
@@ -148,7 +148,7 @@
148148
"@octokit/rest": "18.3.5",
149149
"@rollup/plugin-commonjs": "^21.0.0",
150150
"@rollup/plugin-node-resolve": "^13.1.3",
151-
"@schematics/angular": "^17.0.0-next.4",
151+
"@schematics/angular": "^17.0.0-next.6",
152152
"@types/babel__core": "^7.1.18",
153153
"@types/browser-sync": "^2.26.3",
154154
"@types/fs-extra": "^9.0.13",

src/cdk/schematics/ng-generate/drag-drop/index.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('CDK drag-drop schematic', () => {
1919
});
2020

2121
it('should create drag-drop files and add them to module', async () => {
22-
const app = await createTestApp(runner);
22+
const app = await createTestApp(runner, {standalone: false});
2323
const tree = await runner.runSchematic('drag-drop', baseOptions, app);
2424
const moduleContent = getFileContent(tree, '/projects/material/src/app/app.module.ts');
2525
const files = tree.files;
@@ -34,7 +34,7 @@ describe('CDK drag-drop schematic', () => {
3434
});
3535

3636
it('should add drag-drop module', async () => {
37-
const app = await createTestApp(runner);
37+
const app = await createTestApp(runner, {standalone: false});
3838
const tree = await runner.runSchematic('drag-drop', baseOptions, app);
3939
const moduleContent = getFileContent(tree, '/projects/material/src/app/app.module.ts');
4040

@@ -43,7 +43,7 @@ describe('CDK drag-drop schematic', () => {
4343

4444
describe('standalone option', () => {
4545
it('should generate a standalone component', async () => {
46-
const app = await createTestApp(runner);
46+
const app = await createTestApp(runner, {standalone: false});
4747
const tree = await runner.runSchematic('drag-drop', {...baseOptions, standalone: true}, app);
4848
const module = getFileContent(tree, '/projects/material/src/app/app.module.ts');
4949
const component = getFileContent(tree, '/projects/material/src/app/foo/foo.component.ts');
@@ -83,7 +83,7 @@ describe('CDK drag-drop schematic', () => {
8383
});
8484

8585
it('should respect the deprecated "styleext" option value', async () => {
86-
let tree = await createTestApp(runner);
86+
let tree = await createTestApp(runner, {standalone: false});
8787
tree.overwrite(
8888
'angular.json',
8989
JSON.stringify({
@@ -185,7 +185,7 @@ describe('CDK drag-drop schematic', () => {
185185
});
186186

187187
it('should respect the deprecated global "spec" option value', async () => {
188-
let tree = await createTestApp(runner);
188+
let tree = await createTestApp(runner, {standalone: false});
189189
tree.overwrite(
190190
'angular.json',
191191
JSON.stringify({

src/material/schematics/ng-add/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('ng-add schematic', () => {
2626

2727
beforeEach(async () => {
2828
runner = new SchematicTestRunner('schematics', COLLECTION_PATH);
29-
appTree = await createTestApp(runner);
29+
appTree = await createTestApp(runner, {standalone: false});
3030

3131
errorOutput = [];
3232
warnOutput = [];

src/material/schematics/ng-generate/address-form/index.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Material address-form schematic', () => {
1616
});
1717

1818
it('should create address-form files and add them to module', async () => {
19-
const app = await createTestApp(runner);
19+
const app = await createTestApp(runner, {standalone: false});
2020
const tree = await runner.runSchematic('address-form', baseOptions, app);
2121
const files = tree.files;
2222

@@ -31,7 +31,7 @@ describe('Material address-form schematic', () => {
3131
});
3232

3333
it('should add address-form imports to module', async () => {
34-
const app = await createTestApp(runner);
34+
const app = await createTestApp(runner, {standalone: false});
3535
const tree = await runner.runSchematic('address-form', baseOptions, app);
3636
const moduleContent = getFileContent(tree, '/projects/material/src/app/app.module.ts');
3737

@@ -52,7 +52,7 @@ describe('Material address-form schematic', () => {
5252

5353
describe('standalone option', () => {
5454
it('should generate a standalone component', async () => {
55-
const app = await createTestApp(runner);
55+
const app = await createTestApp(runner, {standalone: false});
5656
const tree = await runner.runSchematic(
5757
'address-form',
5858
{...baseOptions, standalone: true},

src/material/schematics/ng-generate/dashboard/index.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('material-dashboard-schematic', () => {
1616
});
1717

1818
it('should create dashboard files and add them to module', async () => {
19-
const app = await createTestApp(runner);
19+
const app = await createTestApp(runner, {standalone: false});
2020
const tree = await runner.runSchematic('dashboard', baseOptions, app);
2121
const files = tree.files;
2222

@@ -31,7 +31,7 @@ describe('material-dashboard-schematic', () => {
3131
});
3232

3333
it('should add dashboard imports to module', async () => {
34-
const app = await createTestApp(runner);
34+
const app = await createTestApp(runner, {standalone: false});
3535
const tree = await runner.runSchematic('dashboard', baseOptions, app);
3636
const moduleContent = getFileContent(tree, '/projects/material/src/app/app.module.ts');
3737

@@ -60,7 +60,7 @@ describe('material-dashboard-schematic', () => {
6060

6161
describe('standalone option', () => {
6262
it('should generate a standalone component', async () => {
63-
const app = await createTestApp(runner);
63+
const app = await createTestApp(runner, {standalone: false});
6464
const tree = await runner.runSchematic('dashboard', {...baseOptions, standalone: true}, app);
6565
const module = getFileContent(tree, '/projects/material/src/app/app.module.ts');
6666
const component = getFileContent(tree, '/projects/material/src/app/foo/foo.component.ts');

src/material/schematics/ng-generate/mdc-migration/rules/components/card/card-styles.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ describe('card styles', () => {
1919

2020
beforeEach(async () => {
2121
runner = createNewTestRunner();
22-
cliAppTree = patchDevkitTreeToExposeTypeScript(await createTestApp(runner));
22+
cliAppTree = patchDevkitTreeToExposeTypeScript(
23+
await createTestApp(runner, {standalone: false}),
24+
);
2325
});
2426

2527
describe('mixin migrations', () => {

src/material/schematics/ng-generate/mdc-migration/rules/components/card/card-template.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ describe('card template migrator', () => {
1919

2020
beforeEach(async () => {
2121
runner = createNewTestRunner();
22-
cliAppTree = patchDevkitTreeToExposeTypeScript(await createTestApp(runner));
22+
cliAppTree = patchDevkitTreeToExposeTypeScript(
23+
await createTestApp(runner, {standalone: false}),
24+
);
2325
});
2426

2527
it('should not update other elements', async () => {

src/material/schematics/ng-generate/mdc-migration/rules/ts-migration/runtime-migrator.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ describe('runtime code migration', () => {
1515

1616
beforeEach(async () => {
1717
runner = createNewTestRunner();
18-
cliAppTree = patchDevkitTreeToExposeTypeScript(await createTestApp(runner));
18+
cliAppTree = patchDevkitTreeToExposeTypeScript(
19+
await createTestApp(runner, {standalone: false}),
20+
);
1921
});
2022

2123
async function runMigrationTest(oldFileContent: string, newFileContent: string) {

src/material/schematics/ng-generate/navigation/index.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('material-navigation-schematic', () => {
3535
}
3636

3737
it('should create navigation files and add them to module', async () => {
38-
const app = await createTestApp(runner);
38+
const app = await createTestApp(runner, {standalone: false});
3939
const tree = await runner.runSchematic('navigation', baseOptions, app);
4040
const files = tree.files;
4141

@@ -50,13 +50,13 @@ describe('material-navigation-schematic', () => {
5050
});
5151

5252
it('should add navigation imports to module', async () => {
53-
const app = await createTestApp(runner);
53+
const app = await createTestApp(runner, {standalone: false});
5454
const tree = await runner.runSchematic('navigation', baseOptions, app);
5555
expectNavigationSchematicModuleImports(tree);
5656
});
5757

5858
it('should support `nav` as schematic alias', async () => {
59-
const app = await createTestApp(runner);
59+
const app = await createTestApp(runner, {standalone: false});
6060
const tree = await runner.runSchematic('nav', baseOptions, app);
6161
expectNavigationSchematicModuleImports(tree);
6262
});
@@ -71,7 +71,7 @@ describe('material-navigation-schematic', () => {
7171

7272
describe('standalone option', () => {
7373
it('should generate a standalone component', async () => {
74-
const app = await createTestApp(runner);
74+
const app = await createTestApp(runner, {standalone: false});
7575
const tree = await runner.runSchematic('navigation', {...baseOptions, standalone: true}, app);
7676
const module = getFileContent(tree, '/projects/material/src/app/app.module.ts');
7777
const component = getFileContent(tree, '/projects/material/src/app/foo/foo.component.ts');

src/material/schematics/ng-generate/table/index.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('material-table-schematic', () => {
1616
});
1717

1818
it('should create table files and add them to module', async () => {
19-
const app = await createTestApp(runner);
19+
const app = await createTestApp(runner, {standalone: false});
2020
const tree = await runner.runSchematic('table', baseOptions, app);
2121
const files = tree.files;
2222

@@ -47,7 +47,7 @@ describe('material-table-schematic', () => {
4747
});
4848

4949
it('should add table imports to module', async () => {
50-
const app = await createTestApp(runner);
50+
const app = await createTestApp(runner, {standalone: false});
5151
const tree = await runner.runSchematic('table', baseOptions, app);
5252
const moduleContent = getFileContent(tree, '/projects/material/src/app/app.module.ts');
5353

@@ -72,7 +72,7 @@ describe('material-table-schematic', () => {
7272

7373
describe('standalone option', () => {
7474
it('should generate a standalone component', async () => {
75-
const app = await createTestApp(runner);
75+
const app = await createTestApp(runner, {standalone: false});
7676
const tree = await runner.runSchematic('table', {...baseOptions, standalone: true}, app);
7777
const module = getFileContent(tree, '/projects/material/src/app/app.module.ts');
7878
const component = getFileContent(tree, '/projects/material/src/app/foo/foo.component.ts');

0 commit comments

Comments
 (0)