« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data-validators.js11
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!'));