Created
October 2, 2018 11:12
-
-
Save tsh-code/cf8589513838deeb0bfcf4eeda18121c 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
test('tokenExpired', () => { | |
const token = { token: '123-abc-123', expirationDate: new Date('2018-01-01T12:00:00.000Z') }; | |
const timeBeforeTokenExpiration = new Date('2018-01-01T11:59:00.000Z'); | |
const timeAfterTokenExpiration = new Date('2018-01-01T12:01:00.000Z'); | |
expect(tokenExpired(token, timeBeforeTokenExpiration)).toBe(false); | |
expect(tokenExpired(token, timeAfterTokenExpiration)).toBe(true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment