X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=auto_tests%2Ftests%2Fdate_formats.js;h=f157b8dd4597be4dd1cdca5e0ff0bb4e77e35594;hb=e8c70e4e0f4c124a2c68eb43d6ec4e781d1bf810;hp=05a62c676d1335d4427f406d3a245512eef2ed9f;hpb=795b16307db2a673ba7aa3452f6f6b0e93baeb3a;p=dygraphs.git diff --git a/auto_tests/tests/date_formats.js b/auto_tests/tests/date_formats.js index 05a62c6..f157b8d 100644 --- a/auto_tests/tests/date_formats.js +++ b/auto_tests/tests/date_formats.js @@ -3,15 +3,12 @@ * * @author dan@dygraphs.com (Dan Vanderkam) */ -var dateFormatsTestCase = TestCase("date-formats"); -dateFormatsTestCase.prototype.setUp = function() { -}; +import * as utils from '../../src/dygraph-utils'; -dateFormatsTestCase.prototype.tearDown = function() { -}; +describe("date-formats", function() { -dateFormatsTestCase.prototype.testISO8601 = function() { +it('testISO8601', function() { // Format: YYYY-MM-DDTHH:MM:SS.ddddddZ // The "Z" indicates UTC, so this test should pass regardless of the time // zone of the machine on which it is run. @@ -19,11 +16,11 @@ dateFormatsTestCase.prototype.testISO8601 = function() { // Firefox <4 does not support this format: // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse if (navigator.userAgent.indexOf("Firefox/3.5") == -1) { - assertEquals(946816496789, Dygraph.dateParser("2000-01-02T12:34:56.789012Z")); + assert.equal(946816496789, utils.dateParser("2000-01-02T12:34:56.789012Z")); } -}; +}); -dateFormatsTestCase.prototype.testHyphenatedDate = function() { +it('testHyphenatedDate', function() { // Format: YYYY-MM-DD HH:MM // Midnight February 2, 2000, UTC @@ -36,5 +33,7 @@ dateFormatsTestCase.prototype.testHyphenatedDate = function() { zp(d.getDate()) + ' ' + zp(d.getHours()) + ':' + zp(d.getMinutes()); - assertEquals(Date.UTC(2000, 1, 2), Dygraph.dateParser(str)); -}; + assert.equal(Date.UTC(2000, 1, 2), utils.dateParser(str)); +}); + +});