From: Tim Wood Date: Sun, 31 Mar 2013 17:47:52 +0000 (-0700) Subject: fixing tests for #690 so that they do not fail on the 31st of a month X-Git-Tag: 2.1.0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8c8e95aeba4f0c9a50d69d4a980364a415c5f8a;p=thirdparty%2Fmoment.git fixing tests for #690 so that they do not fail on the 31st of a month --- diff --git a/test/moment/getters_setters.js b/test/moment/getters_setters.js index 809545952..f8e0a0085 100644 --- a/test/moment/getters_setters.js +++ b/test/moment/getters_setters.js @@ -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(); },