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

Jest setup uses promise lib that swallows errors #32727

Closed
Niryo opened this issue Dec 9, 2021 · 2 comments
Closed

Jest setup uses promise lib that swallows errors #32727

Niryo opened this issue Dec 9, 2021 · 2 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Niryo
Copy link

Niryo commented Dec 9, 2021

Description

In jest tests (using react native testing library), errors in async code are getting swallowed by 'promise' lib.
react-native jest setup brings this lib here: https://github.com/facebook/react-native/blob/main/jest/setup.js#L24

here is the open issue in that lib: then/promise#70
what can we do about it? why do we bring this lib in the tests?

Version

0.66.0

Output of react-native info

System:
OS: macOS 10.15.6
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 650.38 MB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.11.0 - ~/.nvm/versions/node/v13.11.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v13.11.0/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v13.11.0/bin/npm
Watchman: 2021.06.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 29, 30
Build Tools: 29.0.0, 29.0.2, 29.0.3
System Images: android-28 | Google Play Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 11.4/11E146 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_251 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. clone this repo: https://github.com/Niryo/minimal-swalloed-error-reproduce
  2. run npm install && jest; you will see that the example test is passing, and there is no indication of an exception.
  3. go to node_modules/react-native/jest/setup and comment out line 24.
  4. run jest again
  5. the test will now fail and we'll see the unhandled exception.

Snack, code example, screenshot, or link to a repository

https://github.com/Niryo/minimal-swalloed-error-reproduce

@github-actions
Copy link

github-actions bot commented Jun 8, 2022

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.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 8, 2022
@github-actions
Copy link

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

@facebook facebook locked as resolved and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

1 participant