test: is.propertyKey
This commit is contained in:
parent
b7bb76d96c
commit
6be375cee8
1 changed files with 11 additions and 3 deletions
14
test/test.ts
14
test/test.ts
|
|
@ -1491,9 +1491,17 @@ test('is.nonEmptyMap', t => {
|
|||
});
|
||||
|
||||
test('is.propertyKey', t => {
|
||||
testType(t, 'string', ['emptyString', 'numericString']);
|
||||
testType(t, 'number', ['nan', 'integer', 'safeInteger', 'infinite']);
|
||||
testType(t, 'symbol');
|
||||
t.true(is.propertyKey('key'));
|
||||
t.true(is.propertyKey(42));
|
||||
t.true(is.propertyKey(Symbol('')));
|
||||
|
||||
t.false(is.propertyKey(null));
|
||||
t.false(is.propertyKey(undefined));
|
||||
t.false(is.propertyKey(true));
|
||||
t.false(is.propertyKey({}));
|
||||
t.false(is.propertyKey([]));
|
||||
t.false(is.propertyKey(new Map()));
|
||||
t.false(is.propertyKey(new Set()));
|
||||
});
|
||||
|
||||
test('is.any', t => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue