|
@@ -55,3 +55,26 @@ describe('Download with notification', (report, done) => {
|
55
|
55
|
})
|
56
|
56
|
|
57
|
57
|
})
|
|
58
|
+
|
|
59
|
+describe('MediaScanner tests ', (report, done) => {
|
|
60
|
+ let filePath = null
|
|
61
|
+ let filename = `scannable-test-${Date.now()}.png`
|
|
62
|
+ RNFetchBlob.fs.getSystemDirs().then((dirs) => {
|
|
63
|
+ filePath = `${dirs.DownloadDir}/${filename}`
|
|
64
|
+ return RNFetchBlob.config({
|
|
65
|
+ path : filePath,
|
|
66
|
+ })
|
|
67
|
+ .fetch('GET', `${TEST_SERVER_URL}/public/github2.jpg`)
|
|
68
|
+ })
|
|
69
|
+ .then((resp) => {
|
|
70
|
+ tmpFilePath = resp.path()
|
|
71
|
+ RNFetchBlob.fs.scanFile([
|
|
72
|
+ { path:resp.path() }
|
|
73
|
+ ])
|
|
74
|
+ .then(() => {
|
|
75
|
+ report(<Assert key="scan success" expect={true} actual={true}/>)
|
|
76
|
+ done()
|
|
77
|
+ })
|
|
78
|
+ })
|
|
79
|
+
|
|
80
|
+})
|