question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest mocks not found on version 1.10.0

See original GitHub issue

Description

Jest does not find react-native-gesture-handler mocks on the last version (1.10.0). Probably related to #1199

Screenshots

image

Steps To Reproduce

  1. Update react-native-gesture-handler to version 1.10.0
  2. Run yarn test

Expected behavior

Run test cases normally as it always does.

Actual behavior

Fails with error: Module <rootDir>/node_modules/react-native-gesture-handler/jestSetup.js in the setupFiles option was not found.

Package versions

  • React: 16.13.1
  • React Native: 0.63.4
  • React Native Gesture Handler: 1.10.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
harika-sabbellacommented, Feb 13, 2021

@jakub-gonet Still not able to use the mock even on latest version 1.10.1 – I see the following error

TypeError: Cannot read property 'Direction' of undefined

      at Object.<anonymous> (node_modules/react-native-gesture-handler/dist/src/Directions.js:2:33)
      at Object.<anonymous> (node_modules/react-native-gesture-handler/dist/index.js:1:3993)
4reactions
lukewlmscommented, Feb 17, 2021

Also seeing “Cannot read property ‘Direction’ of undefined” in 1.10.1. 1.9.0 works fine - reverted for the time being.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest Not Find Mock Module - Stack Overflow
Manual mocks are defined by writing a module in a mocks/ subdirectory immediately adjacent to the module. For example, to mock a module ......
Read more >
Testing with Jest | React Native Gesture Handler
This is unreleased documentation for React Native Gesture Handler Next version. For up-to-date documentation, see the latest version (2.6.0 – 2.8.0).
Read more >
Manual Mocks - Jest
Manual mocks are used to stub out functionality with mock data. For example, instead of accessing a remote resource like a website or...
Read more >
Mockito (Mockito 4.10.0 API) - javadoc.io
Before the release 1.8, Mockito spies were not real partial mocks. The reason was we thought partial mock is a code smell. At...
Read more >
Mocking a JavaScript Class with Jest, two ways to make it easier
A guide on how to mock a JavaScript class using Jest, comparing dependency ... If AUD is not found in the response it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found