Skip to content

Commit 068ced2

Browse files
committed
build: update to latest jasmine and resolve errors
Updates to the latest version of Jasmine and removes some unnecessary `await` statements.
1 parent 51f5924 commit 068ced2

File tree

19 files changed

+34
-34
lines changed

19 files changed

+34
-34
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"@types/glob": "^7.1.3",
101101
"@types/gulp": "4.0.8",
102102
"@types/inquirer": "^7.3.1",
103-
"@types/jasmine": "^3.5.4",
103+
"@types/jasmine": "^3.6.3",
104104
"@types/marked": "^1.2.1",
105105
"@types/merge2": "^0.3.30",
106106
"@types/minimist": "^1.2.0",
@@ -127,8 +127,8 @@
127127
"highlight.js": "^10.4.0",
128128
"husky": "5.0.6",
129129
"inquirer": "^7.1.0",
130-
"jasmine": "^3.5.0",
131-
"jasmine-core": "^3.5.0",
130+
"jasmine": "^3.6.0",
131+
"jasmine-core": "^3.6.0",
132132
"kagekiri": "^1.0.18",
133133
"karma": "^4.4.1",
134134
"karma-browserstack-launcher": "^1.6.0",

src/cdk/schematics/ng-update/test-cases/misc/global-stylesheets.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('global stylesheets migration', () => {
3636
writeFile('/sub_project/assets/test.css', subProjectStylesheet);
3737

3838
// Run the fixers and expect no error to be thrown.
39-
await expectAsync(runFixers()).not.toBeRejected();
39+
expectAsync(runFixers()).not.toBeRejected();
4040

4141
// if the external stylesheet that is not of a project target would have been checked
4242
// by accident, the stylesheet would differ from the original file content.

src/material/autocomplete/testing/shared.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export function runHarnessTests(
148148
it('should throw when selecting an option that is not available', async () => {
149149
const input = await loader.getHarness(autocompleteHarness.with({selector: '#plain'}));
150150
await input.enterText('New');
151-
await expectAsync(input.selectOption({text: 'Texas'})).toBeRejectedWithError(
151+
expectAsync(input.selectOption({text: 'Texas'})).toBeRejectedWithError(
152152
/Could not find a mat-option matching {"text":"Texas"}/);
153153
});
154154
}

src/material/grid-list/testing/shared.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function runHarnessTests(
9090
]);
9191
expect(await tiles[0].getHeaderText()).toBe('Three');
9292
expect(await tiles[1].getHeaderText()).toBe('Three');
93-
await expectAsync(gridList.getTileAtPosition({row: 2, column: 0}))
93+
expectAsync(gridList.getTileAtPosition({row: 2, column: 0}))
9494
.toBeRejectedWithError(/Could not find tile/);
9595

9696
// Update the fourth tile to span over two rows. The previous position

src/material/list/testing/shared.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function runBaseListFunctionalityTests<
194194
const items = await simpleListHarness.getItems();
195195
expect(items.length).toBe(3);
196196
const loader = await items[1].getChildLoader(selectors.content as MatListItemSection);
197-
await expectAsync(loader.getHarness(TestItemContentHarness)).toBeResolved();
197+
expectAsync(loader.getHarness(TestItemContentHarness)).toBeResolved();
198198
});
199199
});
200200
}

src/material/menu/testing/shared.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export function runHarnessTests(
154154

155155
it('should throw when item is not found', async () => {
156156
const menu1 = await loader.getHarness(menuHarness.with({triggerText: 'Menu 1'}));
157-
await expectAsync(menu1.clickItem({text: 'Fake Item'})).toBeRejectedWithError(
157+
expectAsync(menu1.clickItem({text: 'Fake Item'})).toBeRejectedWithError(
158158
/Could not find item matching {"text":"Fake Item"}/);
159159
});
160160

@@ -166,7 +166,7 @@ export function runHarnessTests(
166166

167167
it('should throw when intermediate item does not have submenu', async () => {
168168
const menu1 = await loader.getHarness(menuHarness.with({triggerText: 'Menu 1'}));
169-
await expectAsync(menu1.clickItem({text: 'Leaf Item 1'}, {})).toBeRejectedWithError(
169+
expectAsync(menu1.clickItem({text: 'Leaf Item 1'}, {})).toBeRejectedWithError(
170170
/Item matching {"text":"Leaf Item 1"} does not have a submenu/);
171171
});
172172
});

src/material/paginator/testing/shared.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function runHarnessTests(
9090
instance.showFirstLastButtons = false;
9191
fixture.detectChanges();
9292

93-
await expectAsync(paginator.goToFirstPage()).toBeRejectedWithError(
93+
expectAsync(paginator.goToFirstPage()).toBeRejectedWithError(
9494
/Could not find first page button inside paginator/);
9595
});
9696

@@ -100,7 +100,7 @@ export function runHarnessTests(
100100
instance.showFirstLastButtons = false;
101101
fixture.detectChanges();
102102

103-
await expectAsync(paginator.goToLastPage()).toBeRejectedWithError(
103+
expectAsync(paginator.goToLastPage()).toBeRejectedWithError(
104104
/Could not find last page button inside paginator/);
105105
});
106106

@@ -110,7 +110,7 @@ export function runHarnessTests(
110110
instance.pageSizeOptions = [];
111111
fixture.detectChanges();
112112

113-
await expectAsync(paginator.setPageSize(10)).toBeRejectedWithError(
113+
expectAsync(paginator.setPageSize(10)).toBeRejectedWithError(
114114
/Cannot find page size selector in paginator/);
115115
});
116116
}

src/material/radio/testing/shared.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function runHarnessTests(radioModule: typeof MatRadioModule,
5757
fixture.componentInstance.thirdGroupButtonName = 'other-name';
5858
fixture.detectChanges();
5959

60-
await expectAsync(
60+
expectAsync(
6161
loader.getAllHarnesses(radioGroupHarness.with({name: 'third-group-name'})))
6262
.toBeRejectedWithError(
6363
/locator found a radio-group with name "third-group-name".*have mismatching names/);
@@ -78,7 +78,7 @@ export function runHarnessTests(radioModule: typeof MatRadioModule,
7878
fixture.componentInstance.thirdGroupButtonName = 'other-button-name';
7979
fixture.detectChanges();
8080

81-
await expectAsync(groups[2].getName())
81+
expectAsync(groups[2].getName())
8282
.toBeRejectedWithError(/Radio buttons in radio-group have mismatching names./);
8383
});
8484

@@ -138,7 +138,7 @@ export function runHarnessTests(radioModule: typeof MatRadioModule,
138138

139139
it('should throw error when checking invalid radio button', async () => {
140140
const group = await loader.getHarness(radioGroupHarness.with({name: 'my-group-1-name'}));
141-
await expectAsync(group.checkRadioButton({label: 'opt4'})).toBeRejectedWithError(
141+
expectAsync(group.checkRadioButton({label: 'opt4'})).toBeRejectedWithError(
142142
/Could not find radio button matching {"label":"opt4"}/);
143143
});
144144
});

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

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

276276
it('should throw an error if the "build" target has been changed', async () => {
277277
overwriteTargetBuilder(appTree, 'build', 'thirdparty-builder');
278-
await expectAsync(runner.runSchematicAsync('ng-add-setup-project', {}, appTree).toPromise())
278+
expectAsync(runner.runSchematicAsync('ng-add-setup-project', {}, appTree).toPromise())
279279
.toBeRejectedWithError(/not using the default builders.*build/);
280280
});
281281

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Material address-form schematic', () => {
4545
it('should throw if no name has been specified', async () => {
4646
const appTree = await createTestApp(runner);
4747

48-
await expectAsync(
48+
expectAsync(
4949
runner.runSchematicAsync('address-form', {project: 'material'}, appTree).toPromise())
5050
.toBeRejectedWithError(/required property 'name'/);
5151
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('material-dashboard-schematic', () => {
5656
it('should throw if no name has been specified', async () => {
5757
const appTree = await createTestApp(runner);
5858

59-
await expectAsync(
59+
expectAsync(
6060
runner.runSchematicAsync('dashboard', {project: 'material'}, appTree).toPromise())
6161
.toBeRejectedWithError(/required property 'name'/);
6262
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('material-navigation-schematic', () => {
6464
it('should throw if no name has been specified', async () => {
6565
const appTree = await createTestApp(runner);
6666

67-
await expectAsync(
67+
expectAsync(
6868
runner.runSchematicAsync('navigation', {project: 'material'}, appTree).toPromise())
6969
.toBeRejectedWithError(/required property 'name'/);
7070
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('material-table-schematic', () => {
6060
it('should throw if no name has been specified', async () => {
6161
const appTree = await createTestApp(runner);
6262

63-
await expectAsync(
63+
expectAsync(
6464
runner.runSchematicAsync('table', {project: 'material'}, appTree).toPromise())
6565
.toBeRejectedWithError(/required property 'name'/);
6666
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('Material tree schematic', () => {
4343
it('should throw if no name has been specified', async () => {
4444
const appTree = await createTestApp(runner);
4545

46-
await expectAsync(runner.runSchematicAsync('tree', {project: 'material'}, appTree).toPromise())
46+
expectAsync(runner.runSchematicAsync('tree', {project: 'material'}, appTree).toPromise())
4747
.toBeRejectedWithError(/required property 'name'/);
4848
});
4949

src/material/schematics/ng-update/test-cases/v9/misc/hammer-migration-v9.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('v9 HammerJS removal', () => {
4848
}}
4949
));
5050
addPackageToPackageJson(tree, 'hammerjs', '0.0.0');
51-
await expectAsync(runMigration()).not.toBeRejected();
51+
expectAsync(runMigration()).not.toBeRejected();
5252
});
5353

5454
describe('hammerjs not used', () => {

src/material/snack-bar/testing/shared.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function runHarnessTests(
107107
// retrieved. We expect an error to be thrown.
108108
fixture.componentInstance.openCustom();
109109
snackBar = await loader.getHarness(snackBarHarness);
110-
await expectAsync(snackBar.getMessage()).toBeRejectedWithError(/custom content/);
110+
expectAsync(snackBar.getMessage()).toBeRejectedWithError(/custom content/);
111111
});
112112

113113
it('should be able to get action description of simple snack-bar', async () => {
@@ -119,7 +119,7 @@ export function runHarnessTests(
119119
// cannot be retrieved. We expect an error to be thrown.
120120
fixture.componentInstance.openCustom();
121121
snackBar = await loader.getHarness(snackBarHarness);
122-
await expectAsync(snackBar.getActionDescription()).toBeRejectedWithError(/custom content/);
122+
expectAsync(snackBar.getActionDescription()).toBeRejectedWithError(/custom content/);
123123
});
124124

125125
it('should be able to check whether simple snack-bar has action', async () => {
@@ -135,7 +135,7 @@ export function runHarnessTests(
135135
// be found. We expect an error to be thrown.
136136
fixture.componentInstance.openCustom();
137137
snackBar = await loader.getHarness(snackBarHarness);
138-
await expectAsync(snackBar.hasAction()).toBeRejectedWithError(/custom content/);
138+
expectAsync(snackBar.hasAction()).toBeRejectedWithError(/custom content/);
139139
});
140140

141141
it('should be able to dismiss simple snack-bar with action', async () => {
@@ -154,7 +154,7 @@ export function runHarnessTests(
154154

155155
fixture.componentInstance.openSimple('No action');
156156
snackBar = await loader.getHarness(snackBarHarness);
157-
await expectAsync(snackBar.dismissWithAction()).toBeRejectedWithError(/without action/);
157+
expectAsync(snackBar.dismissWithAction()).toBeRejectedWithError(/without action/);
158158
});
159159

160160
@Component({

src/material/tabs/testing/tab-group-shared.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function runTabGroupHarnessTests(
6767

6868
it('should throw error when attempting to select invalid tab', async () => {
6969
const tabGroup = await loader.getHarness(tabGroupHarness);
70-
await expectAsync(tabGroup.selectTab({label: 'Fake'})).toBeRejectedWithError(
70+
expectAsync(tabGroup.selectTab({label: 'Fake'})).toBeRejectedWithError(
7171
/Cannot find mat-tab matching filter {"label":"Fake"}/);
7272
});
7373

src/material/tabs/testing/tab-nav-bar-shared.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function runTabNavBarHarnessTests(
5151

5252
it('should throw error when attempting to click invalid link', async () => {
5353
const navBar = await loader.getHarness(tabNavBarHarness);
54-
await expectAsync(navBar.clickLink({label: 'Fake'})).toBeRejectedWithError(
54+
expectAsync(navBar.clickLink({label: 'Fake'})).toBeRejectedWithError(
5555
/Cannot find mat-tab-link matching filter {"label":"Fake"}/);
5656
});
5757

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,10 +1959,10 @@
19591959
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762"
19601960
integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==
19611961

1962-
"@types/jasmine@^3.5.4":
1963-
version "3.5.4"
1964-
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.5.4.tgz#8f9b7b03cc6204d2048b08128dac1f341bfe0591"
1965-
integrity sha512-Uc/obv/lRh1t6RMOV6wkiAfYSZ0AOSTJqVl0Th8bHFcDhw4rQ0L60sxVnmOJj+RXbVboAE1Fd/mBclQWARRAsQ==
1962+
"@types/jasmine@^3.6.3":
1963+
version "3.6.3"
1964+
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.6.3.tgz#824df555b8a5114f91619e78d8f59624d6f23050"
1965+
integrity sha512-5QKAG8WfC9XrOgYLXPrxv1G2IIUE6zDyzTWamhNWJO0LqPRUbZ0q0zGHDhDJ7MpFloUuyME/jpBIdPjq3/P3jA==
19661966

19671967
"@types/lodash.debounce@^4.0.6":
19681968
version "4.0.6"
@@ -7734,7 +7734,7 @@ istanbul@^0.4.5:
77347734
which "^1.1.1"
77357735
wordwrap "^1.0.0"
77367736

7737-
jasmine-core@^3.5.0, jasmine-core@^3.6.0, jasmine-core@~3.6.0:
7737+
jasmine-core@^3.6.0, jasmine-core@~3.6.0:
77387738
version "3.6.0"
77397739
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.6.0.tgz#491f3bb23941799c353ceb7a45b38a950ebc5a20"
77407740
integrity sha512-8uQYa7zJN8hq9z+g8z1bqCfdC8eoDAeVnM5sfqs7KHv9/ifoJ500m018fpFc7RDaO6SWCLCXwo/wPSNcdYTgcw==
@@ -7761,7 +7761,7 @@ jasmine@2.8.0:
77617761
glob "^7.0.6"
77627762
jasmine-core "~2.8.0"
77637763

7764-
jasmine@^3.5.0:
7764+
jasmine@^3.6.0:
77657765
version "3.6.4"
77667766
resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.6.4.tgz#1f8e4a0d5028a2dc66942b73b9fef4c32be97ad5"
77677767
integrity sha512-hIeOou6y0BgCOKYgXYveQvlY+PTHgDPajFf+vLCYbMTQ+VjAP9+EQv0nuC9+gyCAAWISRFauB1XUb9kFuOKtcQ==

0 commit comments

Comments
 (0)