build: upgrade jasmine (and related typings) to latest version (#19904)
With these changes, the types are a little stricter now and also not
compatible with Protractor's jasmine-like syntax. So, we have to also
use `@types/jasminewd2` for e2e tests (but not for non-e2e tests).
I also had to "augment" `@types/jasminewd2`, because the latest
typings from [DefinitelyTyped][1] do not reflect the fact that the
`jasminewd2` version (v2.1.0) currently used by Protractor supports
passing a `done` callback to a spec.
[1]: 566e039485/types/jasminewd2/index.d.ts (L9-L15)
Fixes #23952
Closes #24733
PR Close #19904
This commit is contained in:

committed by
Miško Hevery

parent
1e74ea9e60
commit
00c110b055
28
tools/types-ext/jasminewd2.d.ts
vendored
Normal file
28
tools/types-ext/jasminewd2.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* Extended typings for `jasminewd2`.
|
||||
*
|
||||
* The currently used `jasminewd2` version (v2.1.0), supports passing a `done` callback to a spec,
|
||||
* but the latest typings on [DefinitelyTyped][1] do not reflect that.
|
||||
* Overwrite the relevant function signatures to add a `done` callback.
|
||||
*
|
||||
* [1]:
|
||||
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/566e0394859fdc1dc893658ccec6b06372d56a91/types/jasminewd2/index.d.ts#L9-L15
|
||||
*/
|
||||
declare function it(
|
||||
expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
declare function fit(
|
||||
expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
declare function xit(
|
||||
expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
declare function beforeEach(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
declare function afterEach(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
declare function beforeAll(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
declare function afterAll(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
Reference in New Issue
Block a user