Last active
January 23, 2018 11:17
-
-
Save dp21g/3486fbd82757ef243e41b3f6079fc06e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jest tests | |
describe("getTickValues method", () => { | |
const dispformat = "DD-MMM-YYYY hh:mm"; | |
beforeAll(() => { | |
moment.tz.setDefault("Europe/London"); | |
}); | |
it("generates tick values with DST", () => { | |
const d1 = new Date("2017-10-29T00:26:00Z"); //UTC time | |
const d2 = new Date("2017-10-29T02:12:00Z"); //UTC time | |
const expectedValue = "29-Oct-2017 01:00"; | |
expect(moment(getDSTDate(d1, d2)).format(dispformat)).toEqual( | |
expectedValue | |
); | |
}); | |
afterAll(() => { | |
moment.tz.setDefault(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment