From: Iskren Chernev Date: Sun, 3 Aug 2014 00:35:49 +0000 (-0700) Subject: Add test for moment#locale(false) X-Git-Tag: 2.8.2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6307ac453a8ea440b2ee811337ea761dbd40dca2;p=thirdparty%2Fmoment.git Add test for moment#locale(false) --- diff --git a/test/moment/locale.js b/test/moment/locale.js index 361e87b34..933c7f289 100644 --- a/test/moment/locale.js +++ b/test/moment/locale.js @@ -443,6 +443,20 @@ exports.locale = { m.lang("fr"); test.equal(m.locale(), "fr", "m.lang(key) changes instance locale"); + test.done(); + }, + + "moment#locale(false) resets to global locale" : function (test) { + var m = moment(); + + moment.locale("fr"); + m.locale("it"); + + test.equal(moment.locale(), "fr", "global locale is it"); + test.equal(m.locale(), "it", "instance locale is it"); + m.locale(false); + test.equal(m.locale(), "fr", "instance locale reset to global locale"); + test.done(); } };