Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit ca416b9

Browse files
committed
#8 Add media scanner test
1 parent 2224a46 commit ca416b9

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

test/test-android.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,26 @@ describe('Download with notification', (report, done) => {
5555
})
5656

5757
})
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+
})

test/test-init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('GET image from server', (report, done) => {
5151
})
5252
})
5353

54-
require('./test-fs')
54+
// require('./test-fs')
5555
// require('./test-0.1.x-0.4.x')
5656
// require('./test-0.5.x')
5757
require('./test-android')

0 commit comments

Comments
 (0)