From 6bb9dc4d25045382b32e844bd363f217d8e1bc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Fulla?= Date: Sat, 2 Feb 2019 14:15:18 +0100 Subject: [PATCH] Updating main field in package.json and fixing january test (#1605) * Update package.json * Fixing test for January --- package.json | 2 +- test/calendar_test.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index a25574971..917f1b0b7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "version": "2.0.0", "license": "MIT", "homepage": "https://github.com/Hacker0x01/react-datepicker", - "main": "lib", + "main": "lib/index.js", "module": "es", "unpkg": "dist/react-datepicker.min.js", "style": "dist/react-datepicker.min.css", diff --git a/test/calendar_test.js b/test/calendar_test.js index 91a72cb96..0db262167 100644 --- a/test/calendar_test.js +++ b/test/calendar_test.js @@ -309,14 +309,9 @@ describe("Calendar", function() { prevMonth.simulate("click"); - if (utils.getMonth(selected) === 0) { - // This test has issues with January - expect(utils.getMonth(selected)).to.be.equal(0); - } else { - expect(utils.getMonth(selected)).to.be.equal( - utils.getMonth(calendar.state().date) + 1 - ); - } + expect(utils.getMonth(selected)).to.be.equal( + (utils.getMonth(calendar.state().date) + 1) % 12 + ); }); it("should go to next month", function() {