Overloaded is.array to provide support for asserting on items
This commit is contained in:
parent
4b35ad5bec
commit
52ba09c99c
2 changed files with 23 additions and 3 deletions
11
test/test.ts
11
test/test.ts
|
|
@ -641,6 +641,17 @@ test('is.numericString', t => {
|
|||
|
||||
test('is.array', t => {
|
||||
testType(t, 'array', ['emptyArray']);
|
||||
|
||||
t.true(is.array<number>([1, 2, 3], is.number));
|
||||
t.false(is.array<number>([1, '2', 3], is.number));
|
||||
|
||||
t.notThrows(() => {
|
||||
assert.array<number>([1, 2], is.number);
|
||||
});
|
||||
|
||||
t.throws(() => {
|
||||
assert.array<number>([1, '2'], is.number);
|
||||
});
|
||||
});
|
||||
|
||||
test('is.function', t => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue