Meta tweaks

This commit is contained in:
Sindre Sorhus 2022-02-25 16:19:29 +07:00
parent dc2dc9a438
commit 6cbefb9af7
3 changed files with 26 additions and 26 deletions

View file

@ -1403,22 +1403,6 @@ test('is.emptyString', t => {
});
});
test('is.nonEmptyString', t => {
t.false(is.nonEmptyString(''));
t.false(is.nonEmptyString(String()));
t.true(is.nonEmptyString('🦄'));
t.throws(() => {
assert.nonEmptyString('');
});
t.throws(() => {
assert.nonEmptyString(String());
});
t.notThrows(() => {
assert.nonEmptyString('🦄');
});
});
test('is.emptyStringOrWhitespace', t => {
testType(t, 'emptyString', ['string']);
t.true(is.emptyStringOrWhitespace(' '));
@ -1436,6 +1420,22 @@ test('is.emptyStringOrWhitespace', t => {
});
});
test('is.nonEmptyString', t => {
t.false(is.nonEmptyString(''));
t.false(is.nonEmptyString(String()));
t.true(is.nonEmptyString('🦄'));
t.throws(() => {
assert.nonEmptyString('');
});
t.throws(() => {
assert.nonEmptyString(String());
});
t.notThrows(() => {
assert.nonEmptyString('🦄');
});
});
test('is.nonEmptyStringAndNotWhitespace', t => {
t.false(is.nonEmptyStringAndNotWhitespace(' '));
t.true(is.nonEmptyStringAndNotWhitespace('🦄'));