Przeglądaj źródła

Add 0.10.1 test cases

Ben Hsieh 7 lat temu
rodzic
commit
52e988dfeb
1 zmienionych plików z 24 dodań i 0 usunięć
  1. 24
    0
      test/test-0.10.1.js

+ 24
- 0
test/test-0.10.1.js Wyświetl plik

@@ -54,3 +54,27 @@ describe("Invalid promise.resolve call after task is canceled #176", (report, do
54 54
   }, 2000)
55 55
 
56 56
 })
57
+
58
+describe('passing empty value to fs.lstat doest not crash the app #205', (report, done) => {
59
+  let path = fs.dirs.DocumentDir +'/testfile' + Date.now()
60
+  fs.createFile(path, path, 'utf8')
61
+    .then(() => fs.lstat(null))
62
+    .catch(() => {
63
+      done()
64
+    })
65
+})
66
+
67
+describe('media scanner test #203', (report, done) => {
68
+
69
+  RNFetchBlob
70
+  .config({ path : fs.dirs.DownloadDir +'/#203-'+Date.now()+'.png' , appendExt : 'png' })
71
+  .fetch('GET', `${TEST_SERVER_URL}/public/github.png`)
72
+  .then((res) => {
73
+    console.log(res.path())
74
+    fs.scanFile([ { path : res.path() } ])
75
+  })
76
+  .then(() => {
77
+    done()
78
+  })
79
+
80
+})