Skip to content

Start using Jest's "modern" fake-timer implementation. #29767

Closed

Description

@chrisbobbe

Recent improvements have been made to Jest's implementation of fake timers, on an opt-in basis, with a plan to make them the default in the future: jestjs/jest#7776.

Some prep work has been done toward this (#29011), but I don't find an existing issue for the actual change.

Simply flipping the switch to the "modern" implementation gives several test failures, likely due to some combination of

I'm excited for facebook/react-native's own tests to be made more correct, but I particularly hope to draw attention to the fact that React Native apps can't currently use the new implementation (jestjs/jest#10221, #29303, #29754). This is a problem for apps that can't use the legacy implementation either, because of its issues (not having Date.now() faked is a big one).

React Native version:

v0.61.5. (See #29767 (comment), below, for more environment info.)

Activity

  1. github-actions commented on Aug 25, 2020

    @github-actions
    ⚠️ Missing Environment Information
    ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.
  2. chrisbobbe commented on Sep 11, 2020

    @chrisbobbe
    Author

    Ah, here's the missing environment info for the bot 🙂:

    System:
        OS: macOS 10.15.6
        CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
        Memory: 2.87 GB / 16.00 GB
        Shell: 3.2.57 - /bin/bash
      Binaries:
        Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
        Yarn: 1.22.4 - /usr/local/bin/yarn
        npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
        Watchman: 4.9.0 - /usr/local/bin/watchman
      SDKs:
        iOS SDK:
          Platforms: iOS 13.7, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
        Android SDK:
          API Levels: 23, 25, 26, 27, 28, 29
          Build Tools: 27.0.3, 28.0.3, 29.0.2
          System Images: android-28 | Google Play Intel x86 Atom
      IDEs:
        Android Studio: 3.6 AI-192.7142.36.36.6241897
        Xcode: 11.7/11E801a - /usr/bin/xcodebuild
      npmPackages:
        react: 16.9.0 => 16.9.0 
        react-native: 0.61.5 => 0.61.5
    
  3. safaiyeh commented on Oct 28, 2020

    @safaiyeh
    Contributor

    Hi @chrisbobbe thanks for the request & all the details.

    You opened a PR here: https://github.com/facebook/react-native/pull/29754/files

    Would this resolve the Jest issue, if merged in?

  4. github-actions commented on Jun 30, 2023

    @github-actions

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  5. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Jun 30, 2023
  6. github-actions commented on Jul 7, 2023

    @github-actions

    This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Issue Manager AttentionStaleThere has been a lack of activity on this issue and it may be closed soon.Type: EnhancementA new feature or enhancement of an existing feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions