test: is.propertyKey

This commit is contained in:
PopGoesTheWza 2021-09-09 23:33:22 +02:00
parent b7bb76d96c
commit 6be375cee8

View file

@ -1491,9 +1491,17 @@ test('is.nonEmptyMap', t => {
}); });
test('is.propertyKey', t => { test('is.propertyKey', t => {
testType(t, 'string', ['emptyString', 'numericString']); t.true(is.propertyKey('key'));
testType(t, 'number', ['nan', 'integer', 'safeInteger', 'infinite']); t.true(is.propertyKey(42));
testType(t, 'symbol'); 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 => { test('is.any', t => {