We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ae4136 commit 93f23e6Copy full SHA for 93f23e6
packages/jest-util/src/isPromise.ts
@@ -5,6 +5,9 @@
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
+// capture global.Promise before it may potentially be overwritten
9
+const Promise: any = global.Promise;
10
+
11
// see ES2015 spec 25.4.4.5, https://stackoverflow.com/a/38339199
12
const isPromise = (candidate: unknown): candidate is Promise<unknown> =>
13
Promise.resolve(candidate) === candidate;
0 commit comments