|
@@ -10,13 +10,7 @@ import {
|
10
|
10
|
Dimensions,
|
11
|
11
|
Image,
|
12
|
12
|
} from 'react-native';
|
13
|
|
-
|
14
|
|
-
|
15
|
|
-
|
16
|
|
-
|
17
|
|
-
|
18
|
|
-
|
19
|
|
-
|
|
13
|
+import DataStore from 'nedb'
|
20
|
14
|
|
21
|
15
|
const fs = RNFetchBlob.fs
|
22
|
16
|
const { Assert, Comparer, Info, prop } = RNTest
|
|
@@ -30,66 +24,8 @@ const { TEST_SERVER_URL, TEST_SERVER_URL_SSL, FILENAME, DROPBOX_TOKEN, styles }
|
30
|
24
|
const dirs = RNFetchBlob.fs.dirs
|
31
|
25
|
|
32
|
26
|
let prefix = ((Platform.OS === 'android') ? 'file://' : '')
|
|
27
|
+const db = new DataStore()
|
33
|
28
|
|
34
|
|
-describe('test', (report, done) => {
|
35
|
|
-
|
36
|
|
- console.log('start')
|
37
|
|
-
|
38
|
|
- let image = RNTest.prop('image')
|
39
|
|
- let form = new FormData()
|
40
|
|
- form.append("FormData", true)
|
41
|
|
- form.append("access_token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU3YjgyZGQ2MTEwZDcwYmEwYjUxZjM5YyIsImlzTWVkaWMiOnRydWUsImlhdCI6MTQ3MTY4ODE1MiwiZXhwIjoxNDcxNzA2MTUyfQ.gPeql5g66Am4Txl1WqnbvOWJaD8srTK_6vihOJ6kFbY")
|
42
|
|
- form.append("Content-Type", "image/jpg")
|
43
|
|
- form.append('image', {
|
44
|
|
- uri : `data:image/png;base64, ${image}`,
|
45
|
|
- type : 'image/png'
|
46
|
|
- })
|
47
|
|
-
|
48
|
|
- let xhr = new XMLHttpRequest()
|
49
|
|
- xhr.open('post', `${TEST_SERVER_URL}/upload-form`)
|
50
|
|
- xhr.send(form)
|
51
|
|
- console.log(form)
|
52
|
|
- xhr.onerror = function(e) {
|
53
|
|
- console.log('err', e)
|
54
|
|
- }
|
55
|
|
- xhr.onreadystatechange = function() {
|
56
|
|
- console.log('changed')
|
57
|
|
- if(this.readyState === this.DONE) {
|
58
|
|
- console.log(this.response)
|
59
|
|
- }
|
60
|
|
- }
|
61
|
|
-
|
62
|
|
-
|
63
|
|
-
|
64
|
|
-
|
65
|
|
-
|
66
|
|
-
|
67
|
|
-
|
68
|
|
-
|
69
|
|
-
|
70
|
|
-
|
71
|
|
-
|
72
|
|
-
|
73
|
|
-
|
74
|
|
-
|
75
|
|
-
|
76
|
|
-
|
77
|
|
-
|
78
|
|
-
|
79
|
|
-
|
80
|
|
-
|
81
|
|
-
|
82
|
|
-
|
83
|
|
-
|
84
|
|
-
|
85
|
|
-
|
86
|
|
-
|
87
|
|
-
|
88
|
|
-
|
89
|
|
-
|
90
|
|
-
|
91
|
|
-
|
92
|
|
-
|
93
|
|
-
|
|
29
|
+describe('nedb constructor test', (report, done) =>{
|
94
|
30
|
|
95
|
31
|
})
|