Improve the type assertion for is.asyncFunction
This commit is contained in:
parent
af6b03d67f
commit
c25b606c3b
3 changed files with 8 additions and 3 deletions
|
|
@ -560,6 +560,12 @@ test('is.promise', t => {
|
|||
|
||||
test('is.asyncFunction', t => {
|
||||
testType(t, 'asyncFunction', ['function']);
|
||||
|
||||
const fixture = async () => {};
|
||||
if (is.asyncFunction(fixture)) {
|
||||
// eslint-disable-next-line promise/prefer-await-to-then
|
||||
t.true(is.function_(fixture().then));
|
||||
}
|
||||
});
|
||||
|
||||
test('is.generator', t => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue