Skip to content

build: update jasmine types dependency #16834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@types/gulp-util": "^3.0.34",
"@types/hammerjs": "^2.0.35",
"@types/inquirer": "^0.0.43",
"@types/jasmine": "^3.0.0",
"@types/jasmine": "^3.4.0",
"@types/marked": "^0.4.2",
"@types/merge2": "^0.3.30",
"@types/minimist": "^1.2.0",
Expand Down
3 changes: 2 additions & 1 deletion src/cdk/a11y/aria-describer/aria-reference.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ describe('AriaReference', () => {
it('should not add the same reference id if it already exists', () => {
addAriaReferencedId(testElement!, 'aria-describedby', 'reference_1');
addAriaReferencedId(testElement!, 'aria-describedby', 'reference_1');
expect(['reference_1']);
expect(getAriaReferenceIds(testElement!, 'aria-describedby'))
.toEqual(['reference_1']);
});

it('should retrieve ids that are deliminated by extra whitespace', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/table/table.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ describe('CdkTable', () => {

function expectNoStickyStyles(elements: any[]) {
elements.forEach(element => {
expect(element.classList.contains('cdk-table-sticky'));
expect(element.classList.contains('cdk-table-sticky')).toBe(false);
expect(element.style.position).toBe('');
expect(element.style.zIndex || '0').toBe('0');
['top', 'bottom', 'left', 'right'].forEach(d => {
Expand Down
7 changes: 4 additions & 3 deletions src/material-experimental/mdc-chips/chip-row.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ describe('Row Chips', () => {
});

describe('focus management', () => {
it('sends focus to first grid cell on click', () => {
dispatchFakeEvent(chipNativeElement, 'click');
it('sends focus to first grid cell on mousedown', () => {
dispatchFakeEvent(chipNativeElement, 'mousedown');
fixture.detectChanges();

expect(document.activeElement!.classList.contains('mat-chip-row-focusable-text-content'));
expect(document.activeElement!.classList.contains('mat-chip-row-focusable-text-content'))
.toBe(true);
});

it('emits focus only once for multiple focus() calls', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/material/button-toggle/button-toggle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe('MatButtonToggle without forms', () => {
fixture.detectChanges();

expect(buttonToggleInstances[0].checked).toBe(true);
expect(groupInstance.value);
expect(groupInstance.value).toBe('test1');
});

it('should change the vertical state', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/material/core/gestures/gesture-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ xdescribe('GestureConfig', () => {
}));

it('should instantiate HammerJS', () => {
spyOn(window, 'Hammer' as any).and.callThrough();
spyOn(window as any, 'Hammer').and.callThrough();

const fixture = TestBed.createComponent(ButtonWithLongpressHander);
fixture.detectChanges();
Expand All @@ -38,7 +38,7 @@ xdescribe('GestureConfig', () => {
})
.compileComponents();

spyOn(window, 'Hammer' as any).and.callThrough();
spyOn(window as any, 'Hammer').and.callThrough();

const fixture = TestBed.createComponent(ButtonWithLongpressHander);
fixture.detectChanges();
Expand Down
2 changes: 1 addition & 1 deletion src/material/datepicker/year-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('MatYearView', () => {
testComponent.date = new Date(2017, JUL, 31);
fixture.detectChanges();

expect(testComponent.yearView._monthSelected(JUN));
testComponent.yearView._monthSelected(JUN);
fixture.detectChanges();

expect(testComponent.selected).toEqual(new Date(2017, JUN, 30));
Expand Down
2 changes: 1 addition & 1 deletion src/youtube-player/fake-youtube-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function createFakeYtNamespace(): FakeYtNamespace {

for (const [event, callback] of playerSpy.addEventListener.calls.allArgs()) {
if (event === name) {
callback(arg);
callback(arg as YT.PlayerEvent);
Copy link
Member Author

@devversion devversion Aug 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I tried fixing this by improving type-safety in this method overall, but it looks like this is not possible as the passed arg needs to be less tightened. Also the as any cast above can't be replaced with YT.PlayerEvent.

This test utility seems to need a general cleanup for type safety, but out of scope for this PR. The type update just caused a compilation failure as the addEventListener callback type is now inferred properly and expects YT.PlayerEvent.

}
}
};
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1260,10 +1260,10 @@
"@types/rx" "*"
"@types/through" "*"

"@types/jasmine@^3.0.0":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.3.1.tgz#b6c4f356013364e98b583647c7b3b6de6fccd2cc"
integrity sha512-JnKB+cEIFuQZXizZP6N0zxma+JlvowkjefWuL61otVmXN7Ebbs4ka3IbDVIz1pc+TCiT00q925jANz3gQJ9qXw==
"@types/jasmine@^3.4.0":
version "3.4.0"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.4.0.tgz#018c56db42400c092aae47de21f710b7f04e4b06"
integrity sha512-6pUnBg6DuSB55xnxJ5+gW9JOkFrPsXkYAuqqEE8oyrpgDiPQ+TZ+1Zt4S+CHcRJcxyNYXeIXG4vHSzdF6y9Uvw==

"@types/jju@~1.4.0":
version "1.4.1"
Expand Down