MCPcopy
hub / github.com/jestjs/jest / isPromise

Function isPromise

packages/jest-util/src/isPromise.ts:8–16  ·  view source on GitHub ↗
(
  candidate: unknown,
)

Source from the content-addressed store, hash-verified

6 */
7
8export default function isPromise<T = unknown>(
9 candidate: unknown,
10): candidate is PromiseLike<T> {
11 return (
12 candidate != null &&
13 (typeof candidate === 'object' || typeof candidate === 'function') &&
14 typeof (candidate as any).then === 'function'
15 );
16}

Callers 15

_dispatchDescribeFunction · 0.90
callAsyncCircusFnFunction · 0.90
execFunctionFunction · 0.90
execFunctionFunction · 0.90
importMockSyncMethod · 0.90
withImplementationMethod · 0.90
asyncJestLifecycleFunction · 0.90
asyncJestTestFunction · 0.90
concurrentFnFunction · 0.90
addSpecsToSuiteMethod · 0.90
makeResolveMatcherFunction · 0.90
makeRejectMatcherFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected