forked from orbit-oss/is
Fix assertion message for .all and .any (#132)
This commit is contained in:
parent
5ed7e9bb40
commit
b748ab72b6
2 changed files with 50 additions and 4 deletions
35
test/test.ts
35
test/test.ts
|
|
@ -1529,6 +1529,27 @@ test('is.any', t => {
|
|||
t.throws(() => {
|
||||
assert.any(is.string);
|
||||
});
|
||||
|
||||
t.throws(() => {
|
||||
assert.any(is.string, 1, 2, 3);
|
||||
}, {
|
||||
// Removes duplicates:
|
||||
message: /received values of types `number`./
|
||||
});
|
||||
|
||||
t.throws(() => {
|
||||
assert.any(is.string, 1, [4]);
|
||||
}, {
|
||||
// Lists all types:
|
||||
message: /received values of types `number`, `Array`./
|
||||
});
|
||||
|
||||
t.throws(() => {
|
||||
assert.any([is.string, is.nullOrUndefined], 1);
|
||||
}, {
|
||||
// Handles array as first argument:
|
||||
message: /received values of types `number`./
|
||||
});
|
||||
});
|
||||
|
||||
test('is.all', t => {
|
||||
|
|
@ -1570,6 +1591,20 @@ test('is.all', t => {
|
|||
t.throws(() => {
|
||||
assert.all(is.string);
|
||||
});
|
||||
|
||||
t.throws(() => {
|
||||
assert.all(is.string, 1, 2, 3);
|
||||
}, {
|
||||
// Removes duplicates:
|
||||
message: /received values of types `number`./
|
||||
});
|
||||
|
||||
t.throws(() => {
|
||||
assert.all(is.string, 1, [4]);
|
||||
}, {
|
||||
// Lists all types:
|
||||
message: /received values of types `number`, `Array`./
|
||||
});
|
||||
});
|
||||
|
||||
test('assert', t => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue