Skip to content

Commit

Permalink
[router]: remove jest.fakeTimers from expo-router/testing-library (#2…
Browse files Browse the repository at this point in the history
…7512)

# Why

Fix: #27484

`jest.fakeTimers()` are only used by the `<Drawer />`/`<Stack />` for
controlling the animation. This shouldn't be a global setting in
people's tests and it should only be enabled in a case by case basis
when required.

# How

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
  • Loading branch information
marklawlor and expo-bot committed Mar 13, 2024
1 parent 79f7d73 commit f618a31
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/expo-router/CHANGELOG.md
Expand Up @@ -23,6 +23,7 @@
- Fix `push` navigation not pushing the same route multiple times ([#27307](https://github.com/expo/expo/pull/27307) by [@marklawlor](https://github.com/marklawlor))
- Fix router.navigate will only push when path parameters change ([#27285](https://github.com/expo/expo/pull/27285) by [@marklawlor](https://github.com/marklawlor))
- Fix incorrect route generation of array shared groups with brackets ([#27459](https://github.com/expo/expo/pull/27459) by [@marklawlor](https://github.com/marklawlor))
- Remove `jest.fakeTimers()` from `expo-router/testing-library` ([#27512](https://github.com/expo/expo/pull/27512) by [@marklawlor](https://github.com/marklawlor))
- Fix incorrect initial URL on web when using baseUrl ([#27287](https://github.com/expo/expo/pull/27287) by [@marklawlor](https://github.com/marklawlor))

### 💡 Others
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-router/build/testing-library/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/expo-router/build/testing-library/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-router/build/testing-library/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/expo-router/src/testing-library/index.tsx
Expand Up @@ -32,8 +32,6 @@ export function renderRouter(
context: MockContextConfig = './app',
{ initialUrl = '/', ...options }: RenderRouterOptions = {}
): Result {
jest.useFakeTimers();

const mockContext = getMockContext(context);

// Reset the initial URL
Expand Down

0 comments on commit f618a31

Please sign in to comment.