added is.class based on es6 class implementation
This commit is contained in:
parent
103c5afe6f
commit
0a06209d05
2 changed files with 10 additions and 1 deletions
8
test.js
8
test.js
|
|
@ -6,6 +6,7 @@ const isNode8orHigher = Number(process.versions.node.split('.')[0]) >= 8;
|
|||
|
||||
const PromiseSubclassFixture = class extends Promise {};
|
||||
const ErrorSubclassFixture = class extends Error {};
|
||||
const ClassFixture = class A {};
|
||||
|
||||
const types = new Map([
|
||||
['undefined', undefined],
|
||||
|
|
@ -28,6 +29,9 @@ const types = new Map([
|
|||
[1, 2],
|
||||
new Array(2)
|
||||
]],
|
||||
['class', [
|
||||
new ClassFixture()
|
||||
]],
|
||||
['function', [
|
||||
function foo() {}, // eslint-disable-line func-names
|
||||
function () {},
|
||||
|
|
@ -130,6 +134,10 @@ test('is.array', t => {
|
|||
testType(t, 'array');
|
||||
});
|
||||
|
||||
test('is.class', t => {
|
||||
testType(t, 'function');
|
||||
});
|
||||
|
||||
test('is.function', t => {
|
||||
testType(t, 'function');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue