From 8c30898671b0dd1a5fa6e4b77b4a9f4ef81c8ea6 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Sun, 16 Nov 2014 22:30:18 -0800 Subject: [PATCH] Add is_valid tests --- test/moment/is_valid.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/moment/is_valid.js b/test/moment/is_valid.js index 69ac00d2e..c991eaa14 100644 --- a/test/moment/is_valid.js +++ b/test/moment/is_valid.js @@ -276,6 +276,13 @@ exports.isValid = { test.done(); }, + '24:00:00.000 is valid' : function (test) { + test.equal(moment('2014-01-01 24', 'YYYY-MM-DD HH').isValid(), true, '24 is valid'); + test.equal(moment('2014-01-01 24:00', 'YYYY-MM-DD HH:mm').isValid(), true, '24:00 is valid'); + test.equal(moment('2014-01-01 24:01', 'YYYY-MM-DD HH:mm').isValid(), false, '24:01 is not valid'); + test.done(); + }, + 'oddball permissiveness' : function (test) { //https://github.com/moment/moment/issues/1128 test.ok(moment('2010-10-3199', ['MM/DD/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD']).isValid()); -- 2.47.3