chore: added nonEmptyStringAndNotWhitespace

This commit is contained in:
ivan katliarchuk 2022-02-22 09:07:55 +00:00
parent 04ccf21dba
commit 3a9761d4af
No known key found for this signature in database
GPG key ID: 601CDBBBB76E47BE
3 changed files with 34 additions and 0 deletions

View file

@ -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