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:
George Kalpakas
2017-10-24 14:54:08 +03:00
committed by Miško Hevery
parent 1e74ea9e60
commit 00c110b055
59 changed files with 332 additions and 283 deletions

View File

@ -15,7 +15,7 @@ describe('testability example', () => {
describe('using task tracking', () => {
const URL = '/core/testability/ts/whenStable/';
it('times out with a list of tasks', (done) => {
it('times out with a list of tasks', (done: DoneFn) => {
browser.get(URL);
browser.ignoreSynchronization = true;

View File

@ -11,13 +11,13 @@
"rxjs/*": ["../../node_modules/rxjs/*"]
},
"outDir": "../../dist/examples",
"types": ["jasmine", "node", "angular", "systemjs"]
"types": ["angular"]
},
"include": [
"./**/*.ts",
"../../node_modules/zone.js/dist/zone.js.d.ts",
// TODO(i): we can't use protractor's built-in typings because they contain lots of ambient definitions
"../../node_modules/@types/protractor/index.d.ts"
"../../node_modules/@types/jasminewd2/index.d.ts",
"../../tools/types-ext/jasminewd2.d.ts",
"../types.d.ts",
"**/*.ts"
]
}

View File

@ -0,0 +1,19 @@
// WARNING:
// This file is used to build the e2e tests only.
// The rest of the files are included in `/packages/tsconfig.json`.
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": []
},
"include": [
"../../node_modules/@types/jasminewd2/index.d.ts",
"../../tools/types-ext/jasminewd2.d.ts",
"../types.d.ts",
"**/e2e_test/*"
],
"exclude": []
}

View File

@ -50,4 +50,4 @@ describe('upgrade/static (full)', () => {
firstHero = element.all(by.css('ng1-hero')).get(0);
expect(firstHero.element(by.css('h2')).getText()).toEqual('Wonder Woman');
});
});
});

View File

@ -10,7 +10,7 @@ import {ElementFinder, by} from 'protractor';
declare global {
namespace jasmine {
interface Matchers {
interface Matchers<T> {
toBeAHero(): Promise<void>;
toHaveName(exectedName: string): Promise<void>;
}