File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,9 @@ test("script onerror should retry", async () => {
150
150
const loader = new Loader ( { apiKey : "foo" , retries : 1 } ) ;
151
151
const deleteScript = jest . spyOn ( loader , "deleteScript" ) ;
152
152
const rejection = expect ( loader . load ( ) ) . rejects . toBeInstanceOf ( ErrorEvent ) ;
153
- const log = jest . spyOn ( console , "log" ) . mockImplementation ( ( ) => { } )
154
-
153
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
154
+ console . log = jest . fn ( ) ;
155
+
155
156
loader [ "loadErrorCallback" ] ( document . createEvent ( "ErrorEvent" ) ) ;
156
157
loader [ "loadErrorCallback" ] ( document . createEvent ( "ErrorEvent" ) ) ;
157
158
jest . runAllTimers ( ) ;
@@ -161,7 +162,7 @@ test("script onerror should retry", async () => {
161
162
expect ( loader [ "loading" ] ) . toBeFalsy ( ) ;
162
163
expect ( loader [ "errors" ] . length ) . toBe ( 2 ) ;
163
164
expect ( deleteScript ) . toHaveBeenCalledTimes ( 1 ) ;
164
- expect ( log ) . toHaveBeenCalledTimes ( loader . retries ) ;
165
+ expect ( console . log ) . toHaveBeenCalledTimes ( loader . retries ) ;
165
166
} ) ;
166
167
167
168
test ( "singleton should be used" , ( ) => {
You can’t perform that action at this time.
0 commit comments