Skip to content

Commit 279154b

Browse files
committed
test: change from js to ts file
1 parent 2bd738f commit 279154b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export function timeoutPromise(ms: number): Promise<void> {
1515
*
1616
* Note: this stack overflow page gives more info on why we're using this:
1717
* https://stackoverflow.com/a/42787232/915811 (basically, moment.js uses
18-
* Date#now internally).
18+
* Date.now internally).
1919
*/
20-
export function setTestTime(time: string): void {
20+
export function setTestTime(time: number): void {
2121
const date = new Date(time)
2222
// Log human-readable date to help out human testers.
2323
console.log(`Setting test time to ${date}`)
@@ -37,5 +37,6 @@ export function setDefaultTestTime(): void {
3737
* the afterEach clause in test suites that require a mocked date.
3838
*/
3939
export function restoreDateNowBehavior(): void {
40-
Date.now.mockRestore && Date.now.mockRestore()
40+
const now = Date.now as jest.Mock
41+
now.mockRestore && now.mockRestore()
4142
}

0 commit comments

Comments
 (0)