]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Don't test JSON.stringify if it doesn't exist #867
authorTim Wood <washwithcare@gmail.com>
Sun, 7 Jul 2013 19:19:55 +0000 (12:19 -0700)
committerTim Wood <washwithcare@gmail.com>
Sun, 7 Jul 2013 19:19:55 +0000 (12:19 -0700)
test/moment/format.js

index 69702123ec59a8540e8367d6ab0e88d67f6d17d8..1534c064543b681c0d3aec8997980f1e842f6384 100644 (file)
@@ -145,9 +145,13 @@ exports.format = {
         test.expect(supportsJson ? 2 : 1);
 
         test.equal(date.toJSON(), "2012-10-09T20:30:40.678Z", "should output ISO8601 on moment.fn.toJSON");
-        test.equal(JSON.stringify({
-            date : date
-        }), '{"date":"2012-10-09T20:30:40.678Z"}', "should output ISO8601 on JSON.stringify");
+
+        if (supportsJson) {
+            test.equal(JSON.stringify({
+                date : date
+            }), '{"date":"2012-10-09T20:30:40.678Z"}', "should output ISO8601 on JSON.stringify");
+        }
+
         test.done();
     },