chore: added nonEmptyStringAndNotWhitespace
This commit is contained in:
parent
04ccf21dba
commit
3a9761d4af
3 changed files with 34 additions and 0 deletions
17
test/test.ts
17
test/test.ts
|
|
@ -1436,6 +1436,23 @@ test('is.emptyStringOrWhitespace', t => {
|
|||
});
|
||||
});
|
||||
|
||||
test('is.nonEmptyStringAndNotWhitespace', t => {
|
||||
t.false(is.nonEmptyStringAndNotWhitespace(' '));
|
||||
t.false(is.nonEmptyStringAndNotWhitespace('test'));
|
||||
t.false(is.nonEmptyStringAndNotWhitespace(String()));
|
||||
t.true(is.nonEmptyStringAndNotWhitespace('🦄'));
|
||||
|
||||
t.throws(() => {
|
||||
assert.nonEmptyStringAndNotWhitespace('');
|
||||
});
|
||||
t.throws(() => {
|
||||
assert.nonEmptyStringAndNotWhitespace(String());
|
||||
});
|
||||
t.notThrows(() => {
|
||||
assert.nonEmptyStringAndNotWhitespace('🦄');
|
||||
});
|
||||
});
|
||||
|
||||
test('is.emptyObject', t => {
|
||||
t.true(is.emptyObject({}));
|
||||
t.true(is.emptyObject(new Object())); // eslint-disable-line no-new-object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue