« 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.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/data-validators.js b/test/data-validators.js
index e6b8b43e..867068c7 100644
--- a/test/data-validators.js
+++ b/test/data-validators.js
@@ -16,6 +16,7 @@ import {
     // Wiki data
     isDimensions,
     isDirectory,
+    isDuration,
     validateReference,
     validateReferenceList,
 } from '../src/thing/validators.js';
@@ -138,14 +139,24 @@ test('isDimensions', t => {
 });
 
 test('isDirectory', t => {
-    t.plan(5);
+    t.plan(6);
     t.ok(isDirectory('savior-of-the-waking-world'));
     t.ok(isDirectory('MeGaLoVania'));
+    t.ok(isDirectory('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'));
     t.throws(() => isDirectory(123), TypeError);
     t.throws(() => isDirectory(''), TypeError);
     t.throws(() => isDirectory('troll saint nicholas and the quest for the holy pail'), TypeError);
 });
 
+test('isDuration', t => {
+    t.plan(5);
+    t.ok(isDuration(60));
+    t.ok(isDuration(0.02));
+    t.ok(isDuration(0));
+    t.throws(() => isDuration(-1), TypeError);
+    t.throws(() => isDuration('10:25'), TypeError);
+});
+
 test.skip('isName', t => {
     // TODO
 });