Update test.ts

This commit is contained in:
Sindre Sorhus 2022-02-25 16:09:36 +07:00 committed by GitHub
parent 4248929445
commit 6999b8eea1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1440,16 +1440,18 @@ test('is.nonEmptyStringAndNotWhitespace', t => {
t.false(is.nonEmptyStringAndNotWhitespace(' '));
t.true(is.nonEmptyStringAndNotWhitespace('🦄'));
for (const el of [null, undefined, 5, NaN, {}, []]) {
t.false(is.nonEmptyStringAndNotWhitespace(el));
for (const value of [null, undefined, 5, NaN, {}, []]) {
t.false(is.nonEmptyStringAndNotWhitespace(value));
t.throws(() => {
assert.nonEmptyStringAndNotWhitespace(el);
assert.nonEmptyStringAndNotWhitespace(value);
});
}
t.throws(() => {
assert.nonEmptyStringAndNotWhitespace('');
});
t.notThrows(() => {
assert.nonEmptyStringAndNotWhitespace('🦄');
});