Repository navigation
build: upgrade jasmine (and related typings) to latest version #19904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
13c2d4e
build: upgrade jasmine (and related typings) to latest version
gkalpak ac0f6be
fixup! build: upgrade jasmine (and related typings) to latest version
gkalpak 0b9619d
test: make `NgMatchers` type-aware
gkalpak d9b5d4a
refactor: infer type for `it()` assertion functions
gkalpak af521c3
build: upgrade jasmine to 2.99.x and fix tests
gkalpak a1fa87d
refactor: re-organize and "modernize" cjs-jasmine scripts
gkalpak f83f603
test: run unit tests in random order
gkalpak 964a122
build: upgrade jasmine to 3.1.0
gkalpak 0ebba85
build: upgrade karma and related dependencies
gkalpak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😕 |
||
| import {toArray} from 'rxjs/operators'; | ||
|
|
||
| import {HttpClient} from '../src/client'; | ||
|
|
@@ -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); | ||
|
|
@@ -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); | ||
|
|
@@ -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); | ||
|
|
@@ -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; | ||
|
|
@@ -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(); | ||
|
|
@@ -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(); | ||
|
|
@@ -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); | ||
|
|
@@ -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); | ||
|
|
@@ -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(); | ||
|
|
@@ -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(); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the problem??? 😕
There was a problem hiding this comment.
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 😛).
There was a problem hiding this comment.
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=>iitchange.