File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -207,11 +207,14 @@ describe('IndexDB StorageController', () => {
207207 } ) ;
208208
209209 it ( 'handle indexedDB is not accessible' , async ( ) => {
210- jest . spyOn ( idbKeyVal , 'createStore' )
211- . mockImplementationOnce ( ( ) => { throw new Error ( 'Protected' ) ; } ) ;
212- const dbController = require ( '../IndexedDBStorageController' ) ;
213- expect ( idbKeyVal . createStore ) . toHaveBeenCalled ( ) ;
214- expect ( dbController ) . toBeUndefined ( ) ;
210+ jest . isolateModules ( ( ) => {
211+ global . indexedDB = mockIndexedDB ;
212+ jest . spyOn ( idbKeyVal , 'createStore' )
213+ . mockImplementationOnce ( ( ) => { throw new Error ( 'Protected' ) ; } ) ;
214+ const dbController = require ( '../IndexedDBStorageController' ) ;
215+ expect ( dbController ) . toBeUndefined ( ) ;
216+ expect ( idbKeyVal . createStore ) . toHaveBeenCalled ( ) ;
217+ } ) ;
215218 } ) ;
216219} ) ;
217220
You can’t perform that action at this time.
0 commit comments