-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handling pending calls inside async tests properly. (#6782)
- Loading branch information
Showing
4 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* @flow */ | ||
|
||
'use strict'; | ||
|
||
import {json as runWithJson} from '../runJest'; | ||
import {skipSuiteOnJestCircus} from '../../scripts/ConditionalTest'; | ||
|
||
describe('async jasmine with pending during test', () => { | ||
skipSuiteOnJestCircus(); | ||
|
||
it('should be reported as a pending test', () => { | ||
const result = runWithJson('jasmine-async', ['pending_in_promise.test.js']); | ||
const json = result.json; | ||
|
||
expect(json.numTotalTests).toBe(1); | ||
expect(json.numPassedTests).toBe(0); | ||
expect(json.numFailedTests).toBe(0); | ||
expect(json.numPendingTests).toBe(1); | ||
}); | ||
}); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
it('skips a test inside a promise', () => | ||
new Promise(() => { | ||
pending('skipped a test inside a promise'); | ||
})); |
This file contains 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