« get me outta code hell

track data - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/data-validators.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-01-23 01:31:37 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-01-23 01:31:37 -0400
commitc3dfb1d5607627e45595347628f39eb7546009da (patch)
tree765c686768dc958527d177ef2146c2fbfb42fbfd /test/data-validators.js
parentca3a698e06bd44346c96f512aebd7fae84d8500b (diff)
track data
Diffstat (limited to 'test/data-validators.js')
-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
 });