Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aio/src/app/layout/doc-viewer/doc-viewer.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ describe('DocViewerComponent', () => {
describe(`(.${NO_ANIMATIONS}: ${noAnimations})`, () => {
beforeEach(() => docViewerEl.classList[noAnimations ? 'add' : 'remove'](NO_ANIMATIONS));

it('should return an observable', (done: DoneFn) => {
it('should return an observable', done => {
docViewer.swapViews().subscribe(done, done.fail);
});

Expand Down
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ if [[ ${BUILD_ALL} == true && ${TYPECHECK_ALL} == true ]]; then
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
$TSC -p ${TSCONFIG}
travisFoldEnd "tsc -p ${TSCONFIG}"
TSCONFIG="packages/examples/tsconfig.json"
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
$TSC -p ${TSCONFIG}
travisFoldEnd "tsc -p ${TSCONFIG}"
TSCONFIG="modules/tsconfig.json"
travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace"
$TSC -p ${TSCONFIG}
Expand Down
5 changes: 4 additions & 1 deletion integration/dynamic-compiler/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"compilerOptions": {
"outDir": "../dist/e2e",
"types": ["jasmine"],
"types": [
"jasmine",
"jasminewd2"
],
"skipLibCheck": true
}
}
3 changes: 2 additions & 1 deletion integration/dynamic-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
},
"license": "MIT",
"devDependencies": {
"@types/jasmine": "file:../../node_modules/@types/jasmine",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@types/jasmine": "file:../../node_modules/@types/jasmine",
"@types/jasminewd2": "file:../../node_modules/@types/jasminewd2",
"concurrently": "3.4.0",
"lite-server": "2.2.2",
"protractor": "file:../../node_modules/protractor",
Expand Down
12 changes: 10 additions & 2 deletions karma-js.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/

var browserProvidersConf = require('./browser-providers.conf.js');
var internalAngularReporter = require('./tools/karma/reporter.js');
const browserProvidersConf = require('./browser-providers.conf');
const {generateSeed} = require('./tools/jasmine-seed-generator');
const internalAngularReporter = require('./tools/karma/reporter');

// Karma configuration
// Generated on Thu Sep 25 2014 11:52:02 GMT-0700 (PDT)
Expand All @@ -16,6 +17,13 @@ module.exports = function(config) {

frameworks: ['jasmine'],

client: {
jasmine: {
random: true,
seed: generateSeed('karma-js.conf'),
},
},

files: [
// Sources and specs.
// Loaded through the System loader, in `test-main.js`.
Expand Down
5 changes: 3 additions & 2 deletions modules/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

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

/// <reference path="../node_modules/zone.js/dist/zone.js.d.ts" />
/// <reference path="../node_modules/@types/hammerjs/index.d.ts" />
/// <reference path="../node_modules/@types/jasmine/index.d.ts" />
/// <reference path="../node_modules/@types/jasminewd2/index.d.ts" />
/// <reference path="../node_modules/@types/node/index.d.ts" />
/// <reference path="../node_modules/@types/selenium-webdriver/index.d.ts" />
/// <reference path="../node_modules/zone.js/dist/zone.js.d.ts" />
/// <reference path="../tools/types-ext/jasminewd2.d.ts" />
/// <reference path="./es6-subset.d.ts" />
/// <reference path="./system.d.ts" />
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"@types/diff": "^3.2.2",
"@types/fs-extra": "4.0.2",
"@types/hammerjs": "2.0.35",
"@types/jasmine": "2.2.22-alpha",
"@types/jasmine": "^2.8.8",
"@types/jasminewd2": "^2.0.3",
"@types/minimist": "^1.2.0",
"@types/node": "6.0.88",
"@types/selenium-webdriver": "3.0.7",
Expand Down Expand Up @@ -84,15 +85,15 @@
"hammerjs": "2.0.8",
"husky": "^0.14.3",
"incremental-dom": "0.4.1",
"jasmine": "2.4.1",
"jasmine-core": "2.4.1",
"jasmine": "^3.1.0",
"jasmine-core": "^3.1.0",
"jpm": "1.3.1",
"karma": "0.13.20",
"karma-browserstack-launcher": "0.1.9",
"karma-chrome-launcher": "0.2.0",
"karma-jasmine": "0.3.6",
"karma-sauce-launcher": "0.3.0",
"karma-sourcemap-loader": "0.3.6",
"karma": "^2.0.4",
"karma-browserstack-launcher": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.2",
"karma-sauce-launcher": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"madge": "0.5.0",
"minimist": "1.2.0",
"mutation-observer": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/bazel/test/ngc-wrapped/test_support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface TestSupport {
writeFiles(...mockDirs: {[fileName: string]: string}[]): void;
shouldExist(fileName: string): void;
shouldNotExist(fileName: string): void;
runOneBuild(): void;
runOneBuild(): boolean;
}

export function setup(
Expand Down
12 changes: 5 additions & 7 deletions packages/benchpress/test/metric/user_metric_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ import {Options, PerfLogEvent, PerfLogFeatures, UserMetric, WebDriverAdapter} fr
const metric = createMetric(
[[]], new PerfLogFeatures(),
{userMetrics: {'loadTime': 'time to load', 'content': 'time to see content'}});
metric.beginMeasure()
.then((_) => metric.endMeasure(true))
.then((values: {[key: string]: string}) => {
expect(values['loadTime']).toBe(25);
expect(values['content']).toBe(250);
async.done();
});
metric.beginMeasure().then(() => metric.endMeasure(true)).then(values => {
expect(values['loadTime']).toBe(25);
expect(values['content']).toBe(250);
async.done();
});

wdAdapter.data['loadTime'] = 25;
// Wait before setting 2nd property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {AsyncTestCompleter, describe, expect, iit, inject, it} from '@angular/core/testing/src/testing_internal';
import {AsyncTestCompleter, describe, expect, fit, inject, it} from '@angular/core/testing/src/testing_internal';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the problem??? 😕

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, everything was fine before (and Travis agrees with me 😛).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, had to revert my fit => iit change.


import {ChromeDriverExtension, Injector, Options, WebDriverAdapter, WebDriverExtension} from '../../index';
import {TraceEventFactory} from '../trace_event_factory';
Expand Down
34 changes: 17 additions & 17 deletions packages/common/http/test/client_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {ddescribe, describe, iit, it} from '@angular/core/testing/src/testing_internal';
import {ddescribe, describe, fit, it} from '@angular/core/testing/src/testing_internal';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😕

import {toArray} from 'rxjs/operators';

import {HttpClient} from '../src/client';
Expand All @@ -23,31 +23,31 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
});
afterEach(() => { backend.verify(); });
describe('makes a basic request', () => {
it('for JSON data', (done: DoneFn) => {
it('for JSON data', done => {
client.get('/test').subscribe(res => {
expect((res as any)['data']).toEqual('hello world');
done();
});
backend.expectOne('/test').flush({'data': 'hello world'});
});
it('for text data', (done: DoneFn) => {
it('for text data', done => {
client.get('/test', {responseType: 'text'}).subscribe(res => {
expect(res).toEqual('hello world');
done();
});
backend.expectOne('/test').flush('hello world');
});
it('with headers', (done: DoneFn) => {
it('with headers', done => {
client.get('/test', {headers: {'X-Option': 'true'}}).subscribe(() => done());
const req = backend.expectOne('/test');
expect(req.request.headers.get('X-Option')).toEqual('true');
req.flush({});
});
it('with params', (done: DoneFn) => {
it('with params', done => {
client.get('/test', {params: {'test': 'true'}}).subscribe(() => done());
backend.expectOne('/test?test=true').flush({});
});
it('for an arraybuffer', (done: DoneFn) => {
it('for an arraybuffer', done => {
const body = new ArrayBuffer(4);
client.get('/test', {responseType: 'arraybuffer'}).subscribe(res => {
expect(res).toBe(body);
Expand All @@ -56,7 +56,7 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
backend.expectOne('/test').flush(body);
});
if (typeof Blob !== 'undefined') {
it('for a blob', (done: DoneFn) => {
it('for a blob', done => {
const body = new Blob([new ArrayBuffer(4)]);
client.get('/test', {responseType: 'blob'}).subscribe(res => {
expect(res).toBe(body);
Expand All @@ -65,7 +65,7 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
backend.expectOne('/test').flush(body);
});
}
it('that returns a response', (done: DoneFn) => {
it('that returns a response', done => {
const body = {'data': 'hello world'};
client.get('/test', {observe: 'response'}).subscribe(res => {
expect(res instanceof HttpResponse).toBe(true);
Expand All @@ -74,7 +74,7 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
});
backend.expectOne('/test').flush(body);
});
it('that returns a stream of events', (done: DoneFn) => {
it('that returns a stream of events', done => {
client.get('/test', {observe: 'events'}).pipe(toArray()).toPromise().then(events => {
expect(events.length).toBe(2);
let x = HttpResponse;
Expand All @@ -85,15 +85,15 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
});
backend.expectOne('/test').flush({'data': 'hello world'});
});
it('with progress events enabled', (done: DoneFn) => {
it('with progress events enabled', done => {
client.get('/test', {reportProgress: true}).subscribe(() => done());
const req = backend.expectOne('/test');
expect(req.request.reportProgress).toEqual(true);
req.flush({});
});
});
describe('makes a POST request', () => {
it('with text data', (done: DoneFn) => {
it('with text data', done => {
client.post('/test', 'text body', {observe: 'response', responseType: 'text'})
.subscribe(res => {
expect(res.ok).toBeTruthy();
Expand All @@ -102,7 +102,7 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
});
backend.expectOne('/test').flush('hello world');
});
it('with json data', (done: DoneFn) => {
it('with json data', done => {
const body = {data: 'json body'};
client.post('/test', body, {observe: 'response', responseType: 'text'}).subscribe(res => {
expect(res.ok).toBeTruthy();
Expand All @@ -113,7 +113,7 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
expect(testReq.request.body).toBe(body);
testReq.flush('hello world');
});
it('with a json body of false', (done: DoneFn) => {
it('with a json body of false', done => {
client.post('/test', false, {observe: 'response', responseType: 'text'}).subscribe(res => {
expect(res.ok).toBeTruthy();
expect(res.status).toBe(200);
Expand All @@ -123,7 +123,7 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
expect(testReq.request.body).toBe(false);
testReq.flush('hello world');
});
it('with a json body of 0', (done: DoneFn) => {
it('with a json body of 0', done => {
client.post('/test', 0, {observe: 'response', responseType: 'text'}).subscribe(res => {
expect(res.ok).toBeTruthy();
expect(res.status).toBe(200);
Expand All @@ -133,7 +133,7 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
expect(testReq.request.body).toBe(0);
testReq.flush('hello world');
});
it('with an arraybuffer', (done: DoneFn) => {
it('with an arraybuffer', done => {
const body = new ArrayBuffer(4);
client.post('/test', body, {observe: 'response', responseType: 'text'}).subscribe(res => {
expect(res.ok).toBeTruthy();
Expand All @@ -146,14 +146,14 @@ import {HttpClientTestingBackend} from '../testing/src/backend';
});
});
describe('makes a JSONP request', () => {
it('with properly set method and callback', (done: DoneFn) => {
it('with properly set method and callback', done => {
client.jsonp('/test', 'myCallback').subscribe(() => done());
backend.expectOne({method: 'JSONP', url: '/test?myCallback=JSONP_CALLBACK'})
.flush('hello world');
});
});
describe('makes a request for an error response', () => {
it('with a JSON body', (done: DoneFn) => {
it('with a JSON body', done => {
client.get('/test').subscribe(() => {}, (res: HttpErrorResponse) => {
expect(res.error.data).toEqual('hello world');
done();
Expand Down
6 changes: 3 additions & 3 deletions packages/common/http/test/jsonp_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const SAMPLE_REQ = new HttpRequest<never>('JSONP', '/test');
document = new MockDocument();
backend = new JsonpClientBackend(home, document);
});
it('handles a basic request', (done: DoneFn) => {
it('handles a basic request', done => {
backend.handle(SAMPLE_REQ).pipe(toArray()).subscribe(events => {
expect(events.map(event => event.type)).toEqual([
HttpEventType.Sent,
Expand All @@ -46,7 +46,7 @@ const SAMPLE_REQ = new HttpRequest<never>('JSONP', '/test');
runOnlyCallback(home, {data: 'This is a test'});
document.mockLoad();
});
it('handles an error response properly', (done: DoneFn) => {
it('handles an error response properly', done => {
const error = new Error('This is a test error');
backend.handle(SAMPLE_REQ).pipe(toArray()).subscribe(undefined, (err: HttpErrorResponse) => {
expect(err.status).toBe(0);
Expand All @@ -62,7 +62,7 @@ const SAMPLE_REQ = new HttpRequest<never>('JSONP', '/test');
it('when response type is not json',
() => expect(() => backend.handle(SAMPLE_REQ.clone<never>({responseType: 'text'})))
.toThrowError(JSONP_ERR_WRONG_RESPONSE_TYPE));
it('when callback is never called', (done: DoneFn) => {
it('when callback is never called', done => {
backend.handle(SAMPLE_REQ).subscribe(undefined, (err: HttpErrorResponse) => {
expect(err.status).toBe(0);
expect(err.error instanceof Error).toEqual(true);
Expand Down
23 changes: 11 additions & 12 deletions packages/common/http/test/module_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,22 @@ class ReentrantInterceptor implements HttpInterceptor {
],
});
});
it('initializes HttpClient properly', (done: DoneFn) => {
it('initializes HttpClient properly', done => {
injector.get(HttpClient).get('/test', {responseType: 'text'}).subscribe(value => {
expect(value).toBe('ok!');
done();
});
injector.get(HttpTestingController).expectOne('/test').flush('ok!');
});
it('intercepts outbound responses in the order in which interceptors were bound',
(done: DoneFn) => {
injector.get(HttpClient)
.get('/test', {observe: 'response', responseType: 'text'})
.subscribe(value => done());
const req = injector.get(HttpTestingController).expectOne('/test') as TestRequest;
expect(req.request.headers.get('Intercepted')).toEqual('A,B');
req.flush('ok!');
});
it('intercepts inbound responses in the right (reverse binding) order', (done: DoneFn) => {
it('intercepts outbound responses in the order in which interceptors were bound', done => {
injector.get(HttpClient)
.get('/test', {observe: 'response', responseType: 'text'})
.subscribe(value => done());
const req = injector.get(HttpTestingController).expectOne('/test') as TestRequest;
expect(req.request.headers.get('Intercepted')).toEqual('A,B');
req.flush('ok!');
});
it('intercepts inbound responses in the right (reverse binding) order', done => {
injector.get(HttpClient)
.get('/test', {observe: 'response', responseType: 'text'})
.subscribe(value => {
Expand All @@ -92,7 +91,7 @@ class ReentrantInterceptor implements HttpInterceptor {
});
injector.get(HttpTestingController).expectOne('/test').flush('ok!');
});
it('allows interceptors to inject HttpClient', (done: DoneFn) => {
it('allows interceptors to inject HttpClient', done => {
TestBed.resetTestingModule();
injector = TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
Expand Down
Loading