Tests: Start implementing tests
Some checks failed
discord bot tests / discord bot tests (push) Failing after 9s
Some checks failed
discord bot tests / discord bot tests (push) Failing after 9s
Only convertDateToISOString for now
This commit is contained in:
parent
e04d8857f9
commit
e9242ab032
4 changed files with 3670 additions and 124 deletions
13
tests/convertDateToISOString.test.js
Normal file
13
tests/convertDateToISOString.test.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const convertDateToISOString = require('../util/convertDateToISOString');
|
||||
|
||||
|
||||
|
||||
|
||||
test('Converts to human readable date string', () => {
|
||||
let dates = [new Date("1999-12-31 23:55:00"), new Date(0), new Date(5600000), new Date(1000200000000)]
|
||||
let expectedDateStrings = ["1999-12-31 22:55:00", "1970-01-01 00:00:00", "1970-01-01 01:33:20", "2001-09-11 09:20:00"]
|
||||
for (let i = 0; i < dates.length; i++) {
|
||||
|
||||
expect(convertDateToISOString(dates[i])).toBe(expectedDateStrings[i]);
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue