Atlas › Test

is-promise.mjs|title=isPromise returns `true` on some other thenable|occurrence=1

Exact test identity: mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/is-promise.mjs|title=isPromise returns `true` on some other thenable|occurrence=1

Package
mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test
Suite / test hierarchy
is-promise.mjs|title=isPromise returns `true` on some other thenable|occurrence=1
Test
is-promise.mjs|title=isPromise returns `true` on some other thenable|occurrence=1
Introduced at
is-promise.ts ×1 Frontier kind: Joint frontier
Covered ranges
4
Covered lines
9
Covered files
1

Co-introduced tests

2 other tests enter at the same concept.

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

lib/utils/is-promise.ts 9 covered LOC · 4 ranges

Open complete file

1 > export function isPromise<T>( is-promise.ts
2 > maybePromise: T | Promise<T> is-promise.ts
3 > ): maybePromise is Promise<T> {
4 > return (
5 > !!maybePromise &&
6 > !!(maybePromise as Promise<T>).then &&
7 > typeof (maybePromise as Promise<T>).then === 'function' is-promise.ts
8 > ); is-promise.ts
9 > }