]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
fixing tests for #690 so that they do not fail on the 31st of a month
authorTim Wood <washwithcare@gmail.com>
Sun, 31 Mar 2013 17:47:52 +0000 (10:47 -0700)
committerTim Wood <washwithcare@gmail.com>
Sun, 31 Mar 2013 17:47:52 +0000 (10:47 -0700)
test/moment/getters_setters.js

index 80954595262a6e15ecaee544ce8c12efe8fc8ce5..f8e0a0085d748bedddfe5667ab85db47887b10c8 100644 (file)
@@ -81,18 +81,18 @@ exports.getters_setters = {
         test.equal(a.milliseconds(), 9, 'milliseconds');
         test.done();
     },
-    
+
     "setters strings" : function(test) {
         test.expect(7);
 
-        var a = moment().lang('en');
-        test.equal(a.day(0).day('Wednesday').day(), 3, 'day full name');
-        test.equal(a.day(0).day('Wed').day(), 3, 'day short name');
-        test.equal(a.day(0).day('We').day(), 3, 'day minimal name');
-        test.equal(a.day(0).day('invalid').day(), 0, 'invalid day name');
-        test.equal(a.month(0).month('April').month(), 3, 'month full name');
-        test.equal(a.month(0).month('Apr').month(), 3, 'month short name');
-        test.equal(a.month(0).month('invalid').month(), 0, 'invalid month name');
+        var a = moment([2012]).lang('en');
+        test.equal(a.clone().day(0).day('Wednesday').day(), 3, 'day full name');
+        test.equal(a.clone().day(0).day('Wed').day(), 3, 'day short name');
+        test.equal(a.clone().day(0).day('We').day(), 3, 'day minimal name');
+        test.equal(a.clone().day(0).day('invalid').day(), 0, 'invalid day name');
+        test.equal(a.clone().month(0).month('April').month(), 3, 'month full name');
+        test.equal(a.clone().month(0).month('Apr').month(), 3, 'month short name');
+        test.equal(a.clone().month(0).month('invalid').month(), 0, 'invalid month name');
         test.done();
     },