-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Handling pending calls inside async tests properly. #6782
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #6782 +/- ##
=========================================
- Coverage 66.61% 66.6% -0.02%
=========================================
Files 253 253
Lines 10626 10629 +3
Branches 4 4
=========================================
Hits 7079 7079
- Misses 3546 3549 +3
Partials 1 1
Continue to review full report at Codecov.
|
We're moving towards dropping Jasmine, so not sure if we want this change. @aaronabramov wdyt? |
If we don't wanna do this we should document the fact that jasmine is in maintenance and we'll just fix breaking bugs |
Doesn't hurt to fix this, I guess. |
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.
This is missing an integration test. See contributing.md for information on how to write one.
Also, please update the changelog
@SimenB I've done the changes but I guess circus doesn't have a |
Which one will you prefer?
|
describe('global pending', () => {
skipSuiteOnJestCircus();
it('tests async promise when it skips during the test', () => {
const result = runWithJson('jasmine-async', ['pending_in_promise.test.js']);
const json = result.json;
expect(json.numPendingTests).toBe(1);
});
}); Or something like that? Whatever's cleanest |
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @jest-environment jsdom |
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.
not needed
@SimenB done with the test as well. Moved it out to avoid changing previous tests and now it passes all checks. |
Thanks! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Currently
pending
calls inside async tests causes the test to fail instead of getting skipped. Example:With this PR pending calls inside async tests are handled properly as skipped tests.
Test plan
Was not able to find any tests for the current logic so was not able to figure out the test plan and did a manual testing. If someone can guide me about how to test this I'm willing to write the tests for it.