Skip to content

Commit 00c110b

Browse files
gkalpakmhevery
authored andcommitted
build: upgrade jasmine (and related typings) to latest version (angular#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]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/566e0394859fdc1dc893658ccec6b06372d56a91/types/jasminewd2/index.d.ts#L9-L15 Fixes angular#23952 Closes angular#24733 PR Close angular#19904
1 parent 1e74ea9 commit 00c110b

File tree

59 files changed

+339
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+339
-290
lines changed

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ if [[ ${BUILD_ALL} == true && ${TYPECHECK_ALL} == true ]]; then
409409
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
410410
$TSC -p ${TSCONFIG}
411411
travisFoldEnd "tsc -p ${TSCONFIG}"
412+
TSCONFIG="packages/examples/tsconfig.json"
413+
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
414+
$TSC -p ${TSCONFIG}
415+
travisFoldEnd "tsc -p ${TSCONFIG}"
412416
TSCONFIG="modules/tsconfig.json"
413417
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
414418
$TSC -p ${TSCONFIG}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"compilerOptions": {
33
"outDir": "../dist/e2e",
4-
"types": ["jasmine"],
4+
"types": [
5+
"jasmine",
6+
"jasminewd2"
7+
],
58
"skipLibCheck": true
69
}
710
}

integration/dynamic-compiler/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
},
1919
"license": "MIT",
2020
"devDependencies": {
21-
"@types/jasmine": "file:../../node_modules/@types/jasmine",
2221
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
22+
"@types/jasmine": "file:../../node_modules/@types/jasmine",
23+
"@types/jasminewd2": "file:../../node_modules/@types/jasminewd2",
2324
"concurrently": "3.4.0",
2425
"lite-server": "2.2.2",
2526
"protractor": "file:../../node_modules/protractor",

modules/types.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
// This file contains all ambient imports needed to compile the modules/ source code
1010

11-
/// <reference path="../node_modules/zone.js/dist/zone.js.d.ts" />
1211
/// <reference path="../node_modules/@types/hammerjs/index.d.ts" />
1312
/// <reference path="../node_modules/@types/jasmine/index.d.ts" />
13+
/// <reference path="../node_modules/@types/jasminewd2/index.d.ts" />
1414
/// <reference path="../node_modules/@types/node/index.d.ts" />
15-
/// <reference path="../node_modules/@types/selenium-webdriver/index.d.ts" />
15+
/// <reference path="../node_modules/zone.js/dist/zone.js.d.ts" />
16+
/// <reference path="../tools/types-ext/jasminewd2.d.ts" />
1617
/// <reference path="./es6-subset.d.ts" />
1718
/// <reference path="./system.d.ts" />

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"@types/diff": "^3.2.2",
4848
"@types/fs-extra": "4.0.2",
4949
"@types/hammerjs": "2.0.35",
50-
"@types/jasmine": "2.2.22-alpha",
50+
"@types/jasmine": "^2.8.8",
51+
"@types/jasminewd2": "^2.0.3",
5152
"@types/minimist": "^1.2.0",
5253
"@types/node": "6.0.88",
5354
"@types/selenium-webdriver": "3.0.7",
@@ -84,8 +85,8 @@
8485
"hammerjs": "2.0.8",
8586
"husky": "^0.14.3",
8687
"incremental-dom": "0.4.1",
87-
"jasmine": "2.4.1",
88-
"jasmine-core": "2.4.1",
88+
"jasmine": "2.8",
89+
"jasmine-core": "2.8",
8990
"jpm": "1.3.1",
9091
"karma": "0.13.20",
9192
"karma-browserstack-launcher": "0.1.9",

packages/bazel/test/ngc-wrapped/test_support.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface TestSupport {
3030
writeFiles(...mockDirs: {[fileName: string]: string}[]): void;
3131
shouldExist(fileName: string): void;
3232
shouldNotExist(fileName: string): void;
33-
runOneBuild(): void;
33+
runOneBuild(): boolean;
3434
}
3535

3636
export function setup(

packages/benchpress/test/metric/user_metric_spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ import {Options, PerfLogEvent, PerfLogFeatures, UserMetric, WebDriverAdapter} fr
4848
const metric = createMetric(
4949
[[]], new PerfLogFeatures(),
5050
{userMetrics: {'loadTime': 'time to load', 'content': 'time to see content'}});
51-
metric.beginMeasure()
52-
.then((_) => metric.endMeasure(true))
53-
.then((values: {[key: string]: string}) => {
54-
expect(values['loadTime']).toBe(25);
55-
expect(values['content']).toBe(250);
56-
async.done();
57-
});
51+
metric.beginMeasure().then(() => metric.endMeasure(true)).then(values => {
52+
expect(values['loadTime']).toBe(25);
53+
expect(values['content']).toBe(250);
54+
async.done();
55+
});
5856

5957
wdAdapter.data['loadTime'] = 25;
6058
// Wait before setting 2nd property.

packages/common/test/directives/ng_component_outlet_spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
166166
fixture.componentInstance.currentComponent = Module2InjectedComponent;
167167
fixture.detectChanges();
168168

169-
const moduleRef = fixture.componentInstance.ngComponentOutlet['_moduleRef'];
169+
const moduleRef = fixture.componentInstance.ngComponentOutlet['_moduleRef'] !;
170170
spyOn(moduleRef, 'destroy').and.callThrough();
171171

172-
expect(moduleRef !.destroy).not.toHaveBeenCalled();
172+
expect(moduleRef.destroy).not.toHaveBeenCalled();
173173
fixture.destroy();
174-
expect(moduleRef !.destroy).toHaveBeenCalled();
174+
expect(moduleRef.destroy).toHaveBeenCalled();
175175
}));
176176

177177
it('should not re-create moduleRef when it didn\'t actually change', async(() => {

packages/compiler-cli/integrationtest/ngtools_src/feature2/feature2.module.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ export class FeatureComponent {
1616
@NgModule({
1717
declarations: [FeatureComponent],
1818
imports: [RouterModule.forChild([
19-
{path: '', component: FeatureComponent}, {path: 'd', loadChildren: './default.module'} {
20-
path: 'e',
21-
loadChildren: 'feature/feature.module#FeatureModule'
22-
}
19+
{path: '', component: FeatureComponent},
20+
{path: 'd', loadChildren: './default.module'},
21+
{path: 'e', loadChildren: 'feature/feature.module#FeatureModule'},
2322
])]
2423
})
2524
export class Feature2Module {

packages/compiler-cli/src/ngtools_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import * as ts from 'typescript';
2323

24-
import {CompilerHost, CompilerOptions, LazyRoute} from './transformers/api';
24+
import {CompilerOptions} from './transformers/api';
2525
import {getOriginalReferences} from './transformers/compiler_host';
2626
import {createProgram} from './transformers/entry_points';
2727

0 commit comments

Comments
 (0)