Add is.asyncFunction (#20)
This commit is contained in:
parent
04cb80dfb1
commit
dc3b6ff86b
3 changed files with 27 additions and 2 deletions
12
test.js
12
test.js
|
|
@ -68,6 +68,10 @@ const types = new Map([
|
|||
['generatorFunction', function * () {
|
||||
yield 4;
|
||||
}],
|
||||
['asyncFunction', [
|
||||
async function () {},
|
||||
async () => {}
|
||||
]],
|
||||
['map', new Map()],
|
||||
['set', new Set()],
|
||||
['weakMap', new WeakMap()],
|
||||
|
|
@ -172,7 +176,7 @@ test('is.array', t => {
|
|||
});
|
||||
|
||||
test('is.function', t => {
|
||||
testType(t, 'function', ['generatorFunction']);
|
||||
testType(t, 'function', ['generatorFunction', 'asyncFunction']);
|
||||
});
|
||||
|
||||
test('is.buffer', t => {
|
||||
|
|
@ -215,6 +219,12 @@ test('is.generatorFunction', t => {
|
|||
testType(t, 'generatorFunction', ['function']);
|
||||
});
|
||||
|
||||
if (isNode8orHigher) {
|
||||
test('is.asyncFunction', t => {
|
||||
testType(t, 'asyncFunction', ['function']);
|
||||
});
|
||||
}
|
||||
|
||||
test('is.map', t => {
|
||||
testType(t, 'map');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue