@@ -8,11 +8,8 @@ import {
88import nock from 'nock' ;
99import { type SinonFakeTimers , useFakeTimers } from 'sinon' ;
1010
11+ import { UserProfileService , type UserProfileServiceMessenger } from '.' ;
1112import { HttpError } from '../../controller-utils/src/util' ;
12- import {
13- UserProfileService ,
14- type UserProfileServiceMessenger ,
15- } from '@metamask/user-profile-controller' ;
1613
1714describe ( 'UserProfileService' , ( ) => {
1815 let clock : SinonFakeTimers ;
@@ -134,9 +131,7 @@ describe('UserProfileService', () => {
134131 . times ( 4 )
135132 . reply ( 500 ) ;
136133 const { service, rootMessenger } = getService ( ) ;
137- service . onRetry ( async ( ) => {
138- await clock . nextAsync ( ) ;
139- } ) ;
134+ service . onRetry ( clock . next ) ;
140135
141136 await expect (
142137 rootMessenger . call ( 'UserProfileService:updateProfile' ) ,
@@ -151,9 +146,7 @@ describe('UserProfileService', () => {
151146 . times ( 4 )
152147 . reply ( 500 ) ;
153148 const { service, rootMessenger } = getService ( ) ;
154- service . onRetry ( async ( ) => {
155- await clock . nextAsync ( ) ;
156- } ) ;
149+ service . onRetry ( clock . next ) ;
157150 const onDegradedListener = jest . fn ( ) ;
158151 service . onDegraded ( onDegradedListener ) ;
159152
@@ -171,9 +164,7 @@ describe('UserProfileService', () => {
171164 . times ( 12 )
172165 . reply ( 500 ) ;
173166 const { service, rootMessenger } = getService ( ) ;
174- service . onRetry ( async ( ) => {
175- await clock . nextAsync ( ) ;
176- } ) ;
167+ service . onRetry ( clock . next ) ;
177168 const onBreakListener = jest . fn ( ) ;
178169 service . onBreak ( onBreakListener ) ;
179170
@@ -227,9 +218,7 @@ describe('UserProfileService', () => {
227218 policyOptions : { circuitBreakDuration } ,
228219 } ,
229220 } ) ;
230- service . onRetry ( async ( ) => {
231- await clock . nextAsync ( ) ;
232- } ) ;
221+ service . onRetry ( clock . next ) ;
233222
234223 await expect (
235224 rootMessenger . call ( 'UserProfileService:updateProfile' ) ,
0 commit comments