Add test for getCreationDate
All checks were successful
discord bot tests / discord bot tests (push) Successful in 12s

This commit is contained in:
SileNce5k 2024-10-24 01:34:46 +02:00
parent 4ca13712ed
commit b36a71d517
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -0,0 +1,22 @@
const getCreationDate = require('../util/getCreationDate');
const users = [
{ user: { createdAt: new Date("2016-01-29T14:47:58.915Z") } },
{ user: { createdAt: new Date("2018-08-20T15:51:47.090Z") } },
{ user: { createdAt: new Date("2019-04-08T21:08:11.212Z") } }
]
const humanReadableTime = [
"2016-01-29 14:47:58",
"2018-08-20 15:51:47",
"2019-04-08 21:08:11"
]
test('Testing getCreationDate', () => {
for(let i = 0; i < users.length; i++){
expect(getCreationDate(users[i])).toBe(humanReadableTime[i])
}
});