Add is.numericString() (#67)
This commit is contained in:
parent
9ac56f1be7
commit
7317226c80
3 changed files with 23 additions and 2 deletions
|
|
@ -76,6 +76,14 @@ const types = new Map<string, Test>([
|
|||
Symbol('🦄')
|
||||
]
|
||||
}],
|
||||
['numericString', {
|
||||
is: m.numericString,
|
||||
fixtures: [
|
||||
'5',
|
||||
'-3.2',
|
||||
'Infinity'
|
||||
]
|
||||
}],
|
||||
['array', {
|
||||
is: is.array,
|
||||
fixtures: [
|
||||
|
|
@ -411,7 +419,7 @@ test('is.null', t => {
|
|||
});
|
||||
|
||||
test('is.string', t => {
|
||||
testType(t, 'string', ['emptyString']);
|
||||
testType(t, 'string', ['emptyString', 'numericString']);
|
||||
});
|
||||
|
||||
test('is.number', t => {
|
||||
|
|
@ -426,6 +434,12 @@ test('is.symbol', t => {
|
|||
testType(t, 'symbol');
|
||||
});
|
||||
|
||||
test('is.numericString', t => {
|
||||
testType(t, 'numericString');
|
||||
t.false(m.numericString(''));
|
||||
t.false(m.numericString(1));
|
||||
});
|
||||
|
||||
test('is.array', t => {
|
||||
testType(t, 'array', ['emptyArray']);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue