Created
September 8, 2022 07:40
-
-
Save sipamungkas/8922cded82ac909cd62369957eb17c81 to your computer and use it in GitHub Desktop.
Revisions
-
sipamungkas created this gist
Sep 8, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # React native Blob Util Mock for unit test Package Link: [react-native-blob-util](https://github.com/RonRadtke/react-native-blob-util) ## mock code ```javascript jest.mock('react-native-blob-util', () => { return { __esModule: true, default: { DocumentDir: jest.fn(), config: jest.fn(() => ({ fetch: jest.fn(() => ({ progress: jest.fn().mockResolvedValue(true), })), })), fs: { cp: jest.fn().mockResolvedValue(true), dirs: { CacheDir: '/mockCacheDir', }, unlink: jest.fn(), }, }, }; }); ```