From: Tim Wood Date: Sun, 7 Jul 2013 19:19:55 +0000 (-0700) Subject: Don't test JSON.stringify if it doesn't exist #867 X-Git-Tag: 2.1.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7215fc88de862a18e8f4ff34cfbf081084ae73c;p=thirdparty%2Fmoment.git Don't test JSON.stringify if it doesn't exist #867 --- diff --git a/test/moment/format.js b/test/moment/format.js index 69702123e..1534c0645 100644 --- a/test/moment/format.js +++ b/test/moment/format.js @@ -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(); },