-
Notifications
You must be signed in to change notification settings - Fork 27k
fix(zone.js): only call jasmine test done function once #44923
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
Conversation
0424506 to
56cb25f
Compare
Currently zone.js may end up attempting to call the `done` function of async tests more than once. This used to be a noop, but Jasmine now logs the following warning: ``` An asynchronous function called its 'done' callback more than once. This is a bug in the spec, beforeAll, beforeEach, afterAll, or afterEach function in question. This will be treated as an error in a future version. See<https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0#deprecations-due-to-calling-done-multiple-times> for more information ``` These changes add a wrapper around the `done` function so it only gets called once, otherwise we risk triggering errors in future versions of Jasmine.
56cb25f to
2cf5c40
Compare
|
@crisbeto , the changes LGTM, I just wonder is there a reproduce scenario or repo to describe the error case? |
|
I noticed it both in the tests of this repo and the ones in angular/components. Usually you won't see it, because Bazel doesn't log anything if the test run passes. You can get it to show up by adding a test that always fails. I was testing like this:
|
|
@crisbeto , thank you for the reproduce, I did some debug and find out this maybe a bug of |
|
So I had this fixed in |
|
Closing in favor of #45025. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently zone.js may end up attempting to call the
donefunction of async tests more than once. This used to be a noop, but Jasmine now logs the following warning:These changes add a wrapper around the
donefunction so it only gets called once, otherwise we risk triggering errors in future versions of Jasmine.Note: I couldn't figure out a good way to add a test for this since it would be checking something that's part of the testing infrastructure.