From 6307ac453a8ea440b2ee811337ea761dbd40dca2 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Sat, 2 Aug 2014 17:35:49 -0700 Subject: [PATCH] Add test for moment#locale(false) --- test/moment/locale.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(); } }; -- 2.47.2