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
do not mock global.performance when connected to chrome debugger #2761
Conversation
@@ -371,7 +371,7 @@ if (!NativeReanimatedModule.useOnlyV1) { | |||
: (workletValueSetterJS as <T>(value: T) => void) | |||
); | |||
|
|||
if (!isWeb() && isConfigured()) { | |||
if (!isWeb() && !isChromeDebugger() && isConfigured()) { |
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.
i don't know much about the console mocking here, we could also just mock global.performance if really needed:
if (!global.performance && global._chronoNow) {
global.performance = {
now: global._chronoNow,
}
};
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.
even without chrome debugger global.performance
and global._chronoNow
seem both to be undefined. should we remove the mock in general? I can't see any purpose for it (tested on iOS, maybe things are different on android)
would be great to get your opinion on this @piaskowyk, because as far as I can see you recently worked in that area |
Hey @michaelknoch 👋 |
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.
🚀
Alternative solution to software-mansion#2761
Alternative solution to #2761
…tware-mansion#2761) ## Description Description and motivation for this PR. `global._chronoNow` doesn't seem to be defined when connected to chrome debugger but `global.performance` is defined already. So I think there is no need to mock in that case. Fixes software-mansion#2760 ## Changes do not mock `global.performance` when connected to chrome debugger (same behaviour as for web) <!-- ## Screenshots / GIFs <img width="495" alt="Screenshot 2021-12-17 at 12 48 34" src="https://user-images.githubusercontent.com/5617793/146547028-4f6e6b73-154c-4f31-8b59-5ddae9c1e024.png"> Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before ### After --> ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
…tware-mansion#2771) Alternative solution to software-mansion#2761
Description
Description and motivation for this PR.
global._chronoNow
doesn't seem to be defined when connected to chrome debugger butglobal.performance
is defined already. So I think there is no need to mock in that case.Fixes #2760
Changes
do not mock
global.performance
when connected to chrome debugger (same behaviour as for web)Checklist