From 441b049436fca441c3c89fca7b6b3a4aec65dd0e Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Mon, 24 Aug 2020 17:02:12 -0700 Subject: [PATCH] Jest setup: Stop polyfilling Promise. It looks like this line was introduced in 3ff3987, in 2015, and it has remained in a similar form since then. I haven't found any explanation for it. At facebook/jest#10221 [1], a core Jest maintainer says, """ As an aside, one should never replace `global.Promise` [...]. E.g. when using `async-await` you will always get the native `Promise` regardless of the value of `global.Promise`. """ facebook/jest#10221 is one issue this line has raised, for anyone using the latest features of Jest to test async code in their React Native projects. [1] https://github.com/facebook/jest/issues/10221#issuecomment-654687396 Fixes: #29303 --- jest/setup.js | 1 - 1 file changed, 1 deletion(-) diff --git a/jest/setup.js b/jest/setup.js index 954d9fd76d2740..a6195ad4fa2e62 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -17,7 +17,6 @@ jest.requireActual('../Libraries/polyfills/error-guard'); global.__DEV__ = true; -global.Promise = jest.requireActual('promise'); global.regeneratorRuntime = jest.requireActual('regenerator-runtime/runtime'); global.requestAnimationFrame = function(callback) {