We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2015651 commit 09a3d0dCopy full SHA for 09a3d0d
1 file changed
tests/index.mock.ts
@@ -50,9 +50,12 @@ export const mockFetch = () => {
50
51
export const mockDateToLocaleDateString = () => {
52
global.window = Object.create(window)
53
- Object.defineProperty(window, 'Date()', {
54
- value: {
55
- toLocaleDateString: () => '2023/1/18',
56
- },
+ class MyDate {
+ toLocaleDateString() {
+ return '2023/1/18'
+ }
57
58
+ Object.defineProperty(window, 'Date', {
59
+ value: MyDate,
60
})
61
}
0 commit comments