-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests add watch command
- Loading branch information
Showing
6 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { formClosingDateEst } from './utcToEst'; | ||
|
||
describe('utcToEst', () => { | ||
it('should convert UTC date to EST date in English', () => { | ||
const utcDate = '2023-10-01T12:00:00Z'; | ||
const lang = 'en'; | ||
const result = formClosingDateEst(utcDate, lang); | ||
expect(result).toStrictEqual({ | ||
"day": "01", | ||
"hour": "08", | ||
"minute": "00", | ||
"month": "October", | ||
"year": "2023", | ||
}); | ||
}); | ||
|
||
it('should convert UTC date to EST date in French', () => { | ||
const utcDate = '2023-10-01T12:00:00Z'; | ||
const lang = 'fr'; | ||
const result = formClosingDateEst(utcDate, lang); | ||
expect(result).toStrictEqual({ | ||
"day": "01", | ||
"hour": "08", | ||
"minute": "00", | ||
"month": "octobre", | ||
"year": "2023", | ||
}); | ||
}); | ||
|
||
it('should handle invalid date input', () => { | ||
const utcDate = 'invalid-date'; | ||
const lang = 'en'; | ||
expect(() => formClosingDateEst(utcDate, lang)).toThrow(); | ||
}); | ||
}); |
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
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