Skip to content

Commit f1fdc8b

Browse files
robhoganfacebook-github-bot
authored andcommitted
Stop polyfilling Promise in Jest tests (#34659)
Summary: Pull Request resolved: #34659 We've used this Promise polyfill in Jest setup since at least 2015 ([`3ff3987`](3ff3987)), when native Promise implementations were either non-existent or new and unstable. We no longer need it. It causes issues with "modern" timers in Jest, as documented in: - #29303 - jestjs/jest#10221 It can also obscure real issues due to its default silent handling of uncaught rejections, eg: D39418412. Changelog: [General][Changed] - Don't polyfill Promise in Jest setup Reviewed By: huntie Differential Revision: D39417597 fbshipit-source-id: d12433ed66c06a402632c2e1d525aad112ef9b0c
1 parent feead8f commit f1fdc8b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

jest/setup.js

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ global.performance = {
2121
now: jest.fn(Date.now),
2222
};
2323

24-
global.Promise = jest.requireActual('promise');
2524
global.regeneratorRuntime = jest.requireActual('regenerator-runtime/runtime');
2625
global.window = global;
2726

0 commit comments

Comments
 (0)