From db129147abc424ff17e99a093773d5662ee05943 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 bc27b00e23abf0..db82fc8e59fe8e 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -21,7 +21,6 @@ global.performance = { now: jest.fn(Date.now), }; -global.Promise = jest.requireActual('promise'); global.regeneratorRuntime = jest.requireActual('regenerator-runtime/runtime'); global.requestAnimationFrame = function(callback) {