]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
add() defaults string specifier to milliseconds
authorDieter Luypaert <dieterluypaert@gmail.com>
Mon, 13 Jun 2016 07:51:48 +0000 (09:51 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Wed, 15 Jun 2016 03:40:56 +0000 (20:40 -0700)
src/test/moment/add_subtract.js

index da1f22d67066c83cc5d8559a17645596944d4eec..126a1e7612b623ebff1f7bad67be88c57778fd04 100644 (file)
@@ -285,6 +285,19 @@ test('add strings string short', function (assert) {
     assert.equal(a.add('1', 'Q').month(), 1, 'Add quarter');
 });
 
+test('add no string with milliseconds default', function (assert) {
+    var a = moment();
+    a.year(2011);
+    a.month(9);
+    a.date(12);
+    a.hours(6);
+    a.minutes(7);
+    a.seconds(8);
+    a.milliseconds(500);
+
+    assert.equal(a.add(50).milliseconds(), 550, 'Add milliseconds');
+});
+
 test('subtract strings string short', function (assert) {
     var a = moment();
     a.year(2011);