Bläddra i källkod

Add test case

Ben Hsieh 8 år sedan
förälder
incheckning
4a99eb55da
2 ändrade filer med 18 tillägg och 3 borttagningar
  1. 15
    1
      test/test-0.10.2.js
  2. 3
    2
      test/test-init.js

+ 15
- 1
test/test-0.10.2.js Visa fil

@@ -1,5 +1,6 @@
1 1
 import RNTest from './react-native-testkit/'
2 2
 import React from 'react'
3
+import _ from 'lodash'
3 4
 import RNFetchBlob from 'react-native-fetch-blob'
4 5
 import {
5 6
   StyleSheet,
@@ -21,7 +22,7 @@ const JSONStream = RNFetchBlob.JSONStream
21 22
 const fs = RNFetchBlob.fs
22 23
 const { Assert, Comparer, Info, prop } = RNTest
23 24
 const describe = RNTest.config({
24
-  group : '0.10.1',
25
+  group : '0.10.2',
25 26
   run : true,
26 27
   expand : true,
27 28
   timeout : 20000,
@@ -62,6 +63,19 @@ describe('#230 add and option for setting if the request follow redirect or not'
62 63
 
63 64
 })
64 65
 
66
+describe('#240 openDocument does not support file URI', (report, done) => {
67
+  RNFetchBlob
68
+  .config({ fileCache : true })
69
+  .fetch('GET', `${TEST_SERVER_URL}/public/github.png`)
70
+  .then((res) => {
71
+    RNFetchBlob.ios.openDocument(res.path())
72
+    .then(() => {
73
+      done();
74
+    })
75
+  })
76
+
77
+})
78
+
65 79
 describe('#241 null header silent failed issue', (report, done) => {
66 80
 
67 81
   RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/github.png`, {

+ 3
- 2
test/test-init.js Visa fil

@@ -1,5 +1,6 @@
1 1
 import RNTest from './react-native-testkit/'
2 2
 import React from 'react'
3
+import _ from 'lodash'
3 4
 import RNFetchBlob from 'react-native-fetch-blob'
4 5
 
5 6
 import {
@@ -20,8 +21,8 @@ const { Assert, Comparer, Info, prop } = RNTest
20 21
 prop('FILENAME', `${Platform.OS}-0.10.0-${Date.now()}.png`)
21 22
 prop('TEST_SERVER_URL', 'http://localhost:8123')
22 23
 prop('TEST_SERVER_URL_SSL', 'https://localhost:8124')
23
-// prop('TEST_SERVER_URL', 'http://192.168.17.185:8123')
24
-// prop('TEST_SERVER_URL_SSL', 'https://192.168.17.185:8124')
24
+// prop('TEST_SERVER_URL', 'http://192.168.0.13:8123')
25
+// prop('TEST_SERVER_URL_SSL', 'https://192.168.0.13:8124')
25 26
 prop('DROPBOX_TOKEN', 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4')
26 27
 prop('styles', {
27 28
   image : {