|
@@ -1,44 +0,0 @@
|
1
|
|
-import RNTest from './react-native-testkit/'
|
2
|
|
-import React from 'react'
|
3
|
|
-import RNFetchBlob from 'react-native-fetch-blob'
|
4
|
|
-import DataStore from 'nedb'
|
5
|
|
-import {
|
6
|
|
- StyleSheet,
|
7
|
|
- Text,
|
8
|
|
- View,
|
9
|
|
- ScrollView,
|
10
|
|
- Platform,
|
11
|
|
- Dimensions,
|
12
|
|
- Image,
|
13
|
|
-} from 'react-native';
|
14
|
|
-
|
15
|
|
-const fs = RNFetchBlob.fs
|
16
|
|
-const { Assert, Comparer, Info, prop } = RNTest
|
17
|
|
-const describe = RNTest.config({
|
18
|
|
- group : '0.10.0',
|
19
|
|
- run : true,
|
20
|
|
- expand : true,
|
21
|
|
- timeout : 20000,
|
22
|
|
-})
|
23
|
|
-const { TEST_SERVER_URL, TEST_SERVER_URL_SSL, FILENAME, DROPBOX_TOKEN, styles } = prop()
|
24
|
|
-const dirs = RNFetchBlob.fs.dirs
|
25
|
|
-
|
26
|
|
-let prefix = ((Platform.OS === 'android') ? 'file://' : '')
|
27
|
|
-const DB_PATH = fs.dirs.DocumentDir + `/nedb/test-db-${Date.now()}.db`
|
28
|
|
-const db = null
|
29
|
|
-
|
30
|
|
-describe('nedb persistant constructor test', (report, done) =>{
|
31
|
|
- db = new DataStore(DB_PATH)
|
32
|
|
- // db.loadDatabase(function(err) {
|
33
|
|
- // report(<Assert key="database should created" expect={null} actual={err}/>)
|
34
|
|
- // done()
|
35
|
|
- // })
|
36
|
|
-
|
37
|
|
-})
|
38
|
|
-
|
39
|
|
-describe('db CRUD test', (report, done) => {
|
40
|
|
- let data = 'first record' + Date.now()
|
41
|
|
- db.insert(data, (err, newDoc) => {
|
42
|
|
- console.log(err, newDoc)
|
43
|
|
- })
|
44
|
|
-})
|