diff options
Diffstat (limited to 'test/data-validators.js')
-rw-r--r-- | test/data-validators.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/data-validators.js b/test/data-validators.js index feec127a..739333a3 100644 --- a/test/data-validators.js +++ b/test/data-validators.js @@ -4,6 +4,7 @@ import { showAggregate } from '../src/util/sugar.js'; import { // Basic types isBoolean, + isCountingNumber, isNumber, isString, isStringNonEmpty, @@ -60,6 +61,16 @@ test('isNumber', t => { t.throws(() => isNumber(true), TypeError); }); +test('isCountingNumber', t => { + t.plan(6); + t.ok(isCountingNumber(3)); + t.ok(isCountingNumber(1)); + t.throws(() => isCountingNumber(1.75), TypeError); + t.throws(() => isCountingNumber(0), TypeError); + t.throws(() => isCountingNumber(-1), TypeError); + t.throws(() => isCountingNumber('612'), TypeError); +}); + test('isString', t => { t.plan(3); t.ok(isString('hello!')); |