From c3dfb1d5607627e45595347628f39eb7546009da Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 23 Jan 2022 01:31:37 -0400 Subject: track data --- test/data-validators.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/data-validators.js b/test/data-validators.js index e6b8b43..867068c 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 }); -- cgit 1.3.0-6-gf8a5