-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,14 @@ class TransferMockEvent { | |
global.DragEvent = TransferMockEvent as unknown as typeof DragEvent; | ||
global.ClipboardEvent = TransferMockEvent as unknown as typeof ClipboardEvent; | ||
|
||
// Need before initialize any static methods | ||
global.Date = class extends Date { | ||
constructor(...args: DateConstructor[]) { | ||
// @ts-ignore | ||
Check warning on line 149 in projects/testing/setup-jest/index.ts codefactor.io / CodeFactorprojects/testing/setup-jest/index.ts#L149
|
||
super(...(args.length === 0 ? ['2023-02-15T00:00:00Z'] : args)); | ||
} | ||
} as unknown as DateConstructor; | ||
|
||
/** | ||
* in our jest setupFilesAfterEnv file, | ||
* however when running with ng test those | ||
|