From 9f59fee0d9f0ff51ace46dc079725690e193104c Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Fri, 25 Feb 2022 08:50:24 +0000 Subject: [PATCH] added test coverage --- test/test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test.ts b/test/test.ts index 474ec16..6284e99 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1440,6 +1440,13 @@ 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)); + t.throws(() => { + assert.nonEmptyStringAndNotWhitespace(el); + }); + } + t.throws(() => { assert.nonEmptyStringAndNotWhitespace(''); });