]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
fixing tests
authorIsaac Cambron <isaac@isaaccambron.com>
Thu, 24 Jul 2014 22:31:06 +0000 (18:31 -0400)
committerIsaac Cambron <isaac@isaaccambron.com>
Thu, 24 Jul 2014 22:31:06 +0000 (18:31 -0400)
test/moment/locale.js

index d46b4200fce97eac3f75eac8df80f2b58eaed282..78ad35bc5457910a4604b56676efa77770e44649 100644 (file)
@@ -5,6 +5,7 @@ exports.locale = {
         moment.createFromInputFallback = function () {
             throw new Error("input not handled by moment");
         };
+        moment.locale('en');
         done();
     },
 
@@ -218,6 +219,13 @@ exports.locale = {
         test.done();
     },
 
+    "changing the global locale doesn't affect existing duration instances" : function (test) {
+        var mom = moment.duration()
+        moment.locale('fr');
+        test.equal('en', mom.locale());
+        test.done();
+    },
+
     "duration deprecations" : function (test) {
         test.equal(moment.duration().lang(), moment.duration().localeData(), "duration.lang is the same as duration.localeData");
         test.done();
@@ -415,10 +423,9 @@ exports.locale = {
     },
 
     "changing the global locale doesn't affect existing instances" : function (test) {
-        moment.locale('en');
         var mom = moment();
-        moment.locale('pr');
-        test.equal('en', moment.locale());
+        moment.locale('fr');
+        test.equal('en', mom.locale());
         test.done();
     }
 };