-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(cdk/testing): fix behavior in fakeAsync tests #20638
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
@@ -67,13 +67,22 @@ function uninstallAutoChangeDetectionStatusHandler(fixture: ComponentFixture<unk | |||
} | |||
} | |||
|
|||
/** Whether we are currently in the fake async zone. */ | |||
function isInFakeAsyncZone() { | |||
return Zone?.current.get('FakeAsyncTestZoneSpec') != null; |
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.
If a Zone
global variable isn't defined, this will still throw a TypeError
. You'll have to guard it with typeof Zone !== 'undefined'
to avoid the error, although I'm not sure how likely it is that we'll hit such a case.
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.
Changed it back to !
which is what it actually was originally. I don't think we really support testing without zones currently anyways
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.
LGTM
I've been trying to start using the I tried following the docs for using harnesses but my tests timeout at |
@thw0rted I can't say whether it'll fix your problem, but the change is in the |
Thanks @crisbeto, I will give it a shot. I had meant my questions about behavior to be more aimed at @mmalerba, because the PR didn't have a description, nor did it link to an existing issue, so I had to try to guess at the motivation behind it. From the comments in the commits, it sounded sort of like what I was experiencing, but I wasn't sure. |
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. |
No description provided.