Atlas › Test

is-promise.mjs|title=isPromise returns `false` if passed object has no `then` property|occurrence=1

Exact test identity: mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/is-promise.mjs|title=isPromise returns `false` if passed object has no `then` property|occurrence=1

Package
mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test
Suite / test hierarchy
is-promise.mjs|title=isPromise returns `false` if passed object has no `then` property|occurrence=1
Test
is-promise.mjs|title=isPromise returns `false` if passed object has no `then` property|occurrence=1
Introduced at
is-promise.ts ×2 Frontier kind: Joint frontier
Covered ranges
3
Covered lines
8
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 8 covered LOC · 3 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'
8 > ); is-promise.ts
9 > }