Skip to content

Commit 93f23e6

Browse files
committed
fix for overwritten global.Promise
1 parent 3ae4136 commit 93f23e6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/jest-util/src/isPromise.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
// capture global.Promise before it may potentially be overwritten
9+
const Promise: any = global.Promise;
10+
811
// see ES2015 spec 25.4.4.5, https://stackoverflow.com/a/38339199
912
const isPromise = (candidate: unknown): candidate is Promise<unknown> =>
1013
Promise.resolve(candidate) === candidate;

0 commit comments

Comments
 (0)