File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,11 @@ describe('HTTPTransport', () => {
98
98
const now = Date . now ( ) ;
99
99
const mock = jest
100
100
. spyOn ( Date , 'now' )
101
+ // Initialize _disabledUntil attribute
102
+ . mockReturnValueOnce ( now )
101
103
// Check for first event
102
104
. mockReturnValueOnce ( now )
103
- // Setting disableUntil
105
+ // Setting disabledUntil
104
106
. mockReturnValueOnce ( now )
105
107
// Check for second event
106
108
. mockReturnValueOnce ( now + ( retryAfterSeconds / 2 ) * 1000 )
Original file line number Diff line number Diff line change @@ -104,9 +104,11 @@ describe('HTTPSTransport', () => {
104
104
const now = Date . now ( ) ;
105
105
const mock = jest
106
106
. spyOn ( Date , 'now' )
107
+ // Initialize _disabledUntil attribute
108
+ . mockReturnValueOnce ( now )
107
109
// Check for first event
108
110
. mockReturnValueOnce ( now )
109
- // Setting disableUntil
111
+ // Setting disabledUntil
110
112
. mockReturnValueOnce ( now )
111
113
// Check for second event
112
114
. mockReturnValueOnce ( now + ( retryAfterSeconds / 2 ) * 1000 )
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ function _htmlElementAsString(el: unknown): string {
350
350
* Returns a timestamp in seconds with milliseconds precision.
351
351
*/
352
352
export function timestampWithMs ( ) : number {
353
- return new Date ( ) . getTime ( ) / 1000 ;
353
+ return Date . now ( ) / 1000 ;
354
354
}
355
355
356
356
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
You can’t perform that action at this time.
0 commit comments