fix(zone.js): add issue numbers of @types/jasmine
to the test cases (#34625)
Some cases will still need to use `spy as any` cast, because `@types/jasmine` have some issues, 1. The issue jasmine doesn't handle optional method properties, https://github.com/DefinitelyTyped/DefinitelyTyped/issues/43486 2. The issue jasmine doesn't handle overload method correctly, https://github.com/DefinitelyTyped/DefinitelyTyped/issues/42455 PR Close #34625
This commit is contained in:

committed by
Kara Erickson

parent
b28a5f6eef
commit
421b6a97d6
@ -17,6 +17,7 @@ describe('utils', () => {
|
||||
beforeEach(() => {
|
||||
// TODO: @JiaLiPassion, need to wait @types/jasmine to fix the wrong return
|
||||
// type infer issue.
|
||||
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/43486
|
||||
setTimeoutSpy = spyOn(window, 'setTimeout').and.returnValue(42 as any);
|
||||
clearTimeoutSpy = spyOn(window, 'clearTimeout');
|
||||
});
|
||||
@ -83,8 +84,9 @@ describe('utils', () => {
|
||||
expect(camelToDashCase('foo1Bar2Baz3Qux4')).toBe('foo1-bar2-baz3-qux4');
|
||||
});
|
||||
|
||||
it('should keep existing dashes',
|
||||
() => { expect(camelToDashCase('fooBar-baz-Qux')).toBe('foo-bar-baz--qux'); });
|
||||
it('should keep existing dashes', () => {
|
||||
expect(camelToDashCase('fooBar-baz-Qux')).toBe('foo-bar-baz--qux');
|
||||
});
|
||||
});
|
||||
|
||||
describe('createCustomEvent()', () => {
|
||||
@ -99,7 +101,6 @@ describe('utils', () => {
|
||||
expect(event.cancelable).toBe(false);
|
||||
expect(event.detail).toEqual(value);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('isElement()', () => {
|
||||
@ -131,7 +132,7 @@ describe('utils', () => {
|
||||
it('should return true for functions', () => {
|
||||
const obj = {foo: function() {}, bar: () => null, baz() {}};
|
||||
const fns = [
|
||||
function(){},
|
||||
function() {},
|
||||
() => null,
|
||||
obj.foo,
|
||||
obj.bar,
|
||||
@ -182,7 +183,7 @@ describe('utils', () => {
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
li = div.querySelector('li') !;
|
||||
li = div.querySelector('li')!;
|
||||
});
|
||||
|
||||
it('should return whether the element matches the selector', () => {
|
||||
@ -218,7 +219,9 @@ describe('utils', () => {
|
||||
];
|
||||
|
||||
values.forEach((v1, i) => {
|
||||
values.forEach((v2, j) => { expect(strictEquals(v1, v2)).toBe(i === j); });
|
||||
values.forEach((v2, j) => {
|
||||
expect(strictEquals(v1, v2)).toBe(i === j);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user