Last active
June 24, 2022 14:58
-
-
Save pushkar100/34b994c8a77c63141045794457bf4922 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* src/__tests__/helpers/index.test.js: */ | |
import { isEarlierThanNow } from '../../helpers'; | |
test('isEarlierThanNow, given a timestamp earlier than now, retruns true', () => { | |
// Arrange | |
const date = new Date('1/1/2000'); | |
// Act | |
const actualIsEarlierDateThanNow = isEarlierThanNow(date); | |
// Assert | |
expect(actualIsEarlierDateThanNow).toEqual(true); | |
}); | |
test('isEarlierThanNow, given a timestamp greater than now, returns false', () => { | |
// Arrange | |
const date = new Date('1/1/2060'); | |
// Act | |
const actualIsEarlierDateThanNow = isEarlierThanNow(date); | |
// Assert | |
expect(actualIsEarlierDateThanNow).toEqual(false); | |
}); | |
test('isEarlierThanNow, given a timestamp equal to now, returns false', () => { | |
// Arrange | |
const date = Date.now(); | |
// Act | |
const actualIsEarlierDateThanNow = isEarlierThanNow(date); | |
// Assert | |
expect(actualIsEarlierDateThanNow).toEqual(false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment