build(aio): use correct types for e2e tests

This commit is contained in:
George Kalpakas 2017-11-02 21:31:31 +02:00 committed by Victor Berchet
parent faa621218e
commit 196ce6d475
4 changed files with 18 additions and 6 deletions

View File

@ -3,23 +3,22 @@ import { ApiPage } from './api.po';
describe('Api pages', function() { describe('Api pages', function() {
it('should show direct subclasses of a class', () => { it('should show direct subclasses of a class', () => {
const page = new ApiPage('api/forms/AbstractControlDirective'); const page = new ApiPage('api/forms/AbstractControlDirective');
// We must use `as any` (here and below) because of broken typings for jasmine expect(page.getDescendants('class', true)).toEqual(['ControlContainer', 'NgControl']);
expect(page.getDescendants('class', true)).toEqual(['ControlContainer', 'NgControl'] as any);
}); });
it('should show direct and indirect subclasses of a class', () => { it('should show direct and indirect subclasses of a class', () => {
const page = new ApiPage('api/forms/AbstractControlDirective'); const page = new ApiPage('api/forms/AbstractControlDirective');
expect(page.getDescendants('class')).toEqual(['ControlContainer', 'AbstractFormGroupDirective', 'NgControl'] as any); expect(page.getDescendants('class')).toEqual(['ControlContainer', 'AbstractFormGroupDirective', 'NgControl']);
}); });
it('should show child interfaces that extend an interface', () => { it('should show child interfaces that extend an interface', () => {
const page = new ApiPage('api/forms/Validator'); const page = new ApiPage('api/forms/Validator');
expect(page.getDescendants('interface')).toEqual(['AsyncValidator'] as any); expect(page.getDescendants('interface')).toEqual(['AsyncValidator']);
}); });
it('should show classes that implement an interface', () => { it('should show classes that implement an interface', () => {
const page = new ApiPage('api/animations/AnimationPlayer'); const page = new ApiPage('api/animations/AnimationPlayer');
expect(page.getDescendants('class')).toEqual(['NoopAnimationPlayer', 'MockAnimationPlayer'] as any); expect(page.getDescendants('class')).toEqual(['NoopAnimationPlayer', 'MockAnimationPlayer']);
}); });
it('should show type params of type-aliases', () => { it('should show type params of type-aliases', () => {

View File

@ -2,10 +2,12 @@
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/e2e", "outDir": "../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs", "module": "commonjs",
"target": "es5", "target": "es5",
"types": [ "types": [
"jasmine", "jasmine",
"jasminewd2",
"node" "node"
] ]
} }

View File

@ -90,6 +90,7 @@
"@angular/cli": "^1.5.0-rc.8", "@angular/cli": "^1.5.0-rc.8",
"@angular/compiler-cli": "^5.0.0-rc.9", "@angular/compiler-cli": "^5.0.0-rc.9",
"@types/jasmine": "^2.5.52", "@types/jasmine": "^2.5.52",
"@types/jasminewd2": "^2.0.3",
"@types/node": "~6.0.60", "@types/node": "~6.0.60",
"archiver": "^1.3.0", "archiver": "^1.3.0",
"canonical-path": "^0.0.2", "canonical-path": "^0.0.2",

View File

@ -276,10 +276,20 @@
version "0.9.43" version "0.9.43"
resolved "https://registry.yarnpkg.com/@types/core-js/-/core-js-0.9.43.tgz#65d646c5e8c0cd1bdee37065799f9d3d48748253" resolved "https://registry.yarnpkg.com/@types/core-js/-/core-js-0.9.43.tgz#65d646c5e8c0cd1bdee37065799f9d3d48748253"
"@types/jasmine@*":
version "2.6.2"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.6.2.tgz#6e6d4cb183cd55c7a1ad6270bced10fdd5367a3c"
"@types/jasmine@^2.5.52": "@types/jasmine@^2.5.52":
version "2.6.0" version "2.6.0"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.6.0.tgz#997b41a27752b4850af2683bc4a8d8222c25bd02" resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.6.0.tgz#997b41a27752b4850af2683bc4a8d8222c25bd02"
"@types/jasminewd2@^2.0.3":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@types/jasminewd2/-/jasminewd2-2.0.3.tgz#0d2886b0cbdae4c0eeba55e30792f584bf040a95"
dependencies:
"@types/jasmine" "*"
"@types/mkdirp@^0.3.29": "@types/mkdirp@^0.3.29":
version "0.3.29" version "0.3.29"
resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.3.29.tgz#7f2ad7ec55f914482fc9b1ec4bb1ae6028d46066" resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.3.29.tgz#7f2ad7ec55f914482fc9b1ec4bb1ae6028d46066"