-
Notifications
You must be signed in to change notification settings - Fork 276
Ignore fake timers #1169
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
Ignore fake timers #1169
Conversation
src/helpers/__tests__/timers.test.ts
Outdated
| import { jestFakeTimersAreEnabled } from '../timers'; | ||
| describe('timers', () => { | ||
| it('should not mock timers if SKIP_AUTO_FAKE_TIMERS_DETECTION is set', async () => { | ||
| process.env.SKIP_AUTO_FAKE_TIMERS_DETECTION = 'true'; |
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.
| process.env.SKIP_AUTO_FAKE_TIMERS_DETECTION = 'true'; | |
| process.env.RNTL_SKIP_AUTO_DETECT_FAKE_TIMERS = 'true'; |
Let's add RNTL_ prefix as for RNTL_SKIP_AUTO_CLEANUP.
nit: I've also suggested AUTO_DETECT_FAKE_TIMERS vs AUTO_FAKE_TIMER_DETECTION as slightly more readable.
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.
done
mdjastrzebski
left a comment
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.
Looks good!
@Niryo pls document this settings. This should probably be very brief, you can put it under configuration section in API.md file
|
@mdjastrzebski added docs |
Summary
Allow explicitly disabling automatic jest fake timers detection in order to solve #886
Test plan