Skip to content

Commit 55d3594

Browse files
Add mock for react-native-fs
1 parent 2f1a191 commit 55d3594

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

__mocks__/react-native-fs.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* @format
3+
*/
4+
/* eslint-env jest */
5+
6+
jest.mock('react-native-fs', () => {
7+
return {
8+
mkdir: jest.fn(),
9+
moveFile: jest.fn(),
10+
copyFile: jest.fn(),
11+
pathForBundle: jest.fn(),
12+
pathForGroup: jest.fn(),
13+
getFSInfo: jest.fn(),
14+
getAllExternalFilesDirs: jest.fn(),
15+
unlink: jest.fn(),
16+
exists: jest.fn(),
17+
stopDownload: jest.fn(),
18+
resumeDownload: jest.fn(),
19+
isResumable: jest.fn(),
20+
stopUpload: jest.fn(),
21+
completeHandlerIOS: jest.fn(),
22+
readDir: jest.fn(),
23+
readDirAssets: jest.fn(),
24+
existsAssets: jest.fn(),
25+
readdir: jest.fn(),
26+
setReadable: jest.fn(),
27+
stat: jest.fn(),
28+
readFile: jest.fn(),
29+
read: jest.fn(),
30+
readFileAssets: jest.fn(),
31+
hash: jest.fn(),
32+
copyFileAssets: jest.fn(),
33+
copyFileAssetsIOS: jest.fn(),
34+
copyAssetsVideoIOS: jest.fn(),
35+
writeFile: jest.fn(),
36+
appendFile: jest.fn(),
37+
write: jest.fn(),
38+
downloadFile: jest.fn(),
39+
uploadFiles: jest.fn(),
40+
touch: jest.fn(),
41+
MainBundlePath: jest.fn(),
42+
CachesDirectoryPath: jest.fn(),
43+
DocumentDirectoryPath: jest.fn(),
44+
ExternalDirectoryPath: jest.fn(),
45+
ExternalStorageDirectoryPath: jest.fn(),
46+
TemporaryDirectoryPath: jest.fn(),
47+
LibraryDirectoryPath: jest.fn(),
48+
PicturesDirectoryPath: jest.fn(),
49+
};
50+
});

0 commit comments

Comments
 (0)