Skip to content
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

Merged
merged 4 commits into from
Oct 18, 2022
Merged

Ignore fake timers #1169

merged 4 commits into from
Oct 18, 2022

Conversation

Niryo
Copy link
Contributor

@Niryo Niryo commented Oct 11, 2022

Summary

Allow explicitly disabling automatic jest fake timers detection in order to solve #886

Test plan

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';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@mdjastrzebski mdjastrzebski left a 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

@Niryo
Copy link
Contributor Author

Niryo commented Oct 18, 2022

@mdjastrzebski added docs

@mdjastrzebski mdjastrzebski merged commit 8356d2c into callstack:main Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants