@@ -13,7 +13,7 @@ function createProvider() {
1313
1414const mockHandshake = jest . fn ( ) ;
1515const mockRequest = jest . fn ( ) ;
16- const mockDisconnect = jest . fn ( ) ;
16+ const mockCleanup = jest . fn ( ) ;
1717const mockFetchSignerType = jest . spyOn ( util , 'fetchSignerType' ) ;
1818const mockStoreSignerType = jest . spyOn ( util , 'storeSignerType' ) ;
1919const mockLoadSignerType = jest . spyOn ( util , 'loadSignerType' ) ;
@@ -30,7 +30,7 @@ beforeEach(() => {
3030 chainId : 1 ,
3131 handshake : mockHandshake ,
3232 request : mockRequest ,
33- disconnect : mockDisconnect ,
33+ cleanup : mockCleanup ,
3434 } ;
3535 } ) ;
3636
@@ -148,6 +148,7 @@ describe('Signer configuration', () => {
148148 expect ( mockRequest ) . toHaveBeenCalledWith ( request ) ;
149149
150150 await providerLoadedFromStorage . disconnect ( ) ;
151+ expect ( mockCleanup ) . toHaveBeenCalled ( ) ;
151152 expect ( provider [ 'signer' ] ) . toBeNull ( ) ;
152153 } ) ;
153154
@@ -162,6 +163,7 @@ describe('Signer configuration', () => {
162163 await provider . request ( { method : 'eth_requestAccounts' } ) ;
163164
164165 await provider . disconnect ( ) ;
166+ expect ( mockCleanup ) . toHaveBeenCalled ( ) ;
165167 expect ( provider [ 'signer' ] ) . toBeNull ( ) ;
166168 } ) ;
167169} ) ;
0 commit comments