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

Commit 2925f46

Browse files
committed
Add test file
1 parent 01810fa commit 2925f46

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

test/.babelrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"plugins": [
3+
["module-alias", [
4+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/events.js", "expose": "events" },
5+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/http.js", "expose": "http" },
6+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/path.js", "expose": "path" },
7+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/fs.js", "expose": "fs" },
8+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/url.js", "expose": "url" },
9+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/querystring.js", "expose": "querystring" },
10+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/net.js", "expose": "net" },
11+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/crypto.js", "expose": "crypto" },
12+
{ "src": "./node_modules/react-native-fetch-blob/node-polyfill/stream.js", "expose": "stream" }
13+
]]
14+
],
15+
"extends": "./node_modules/react-native/packager/react-packager/rn-babelrc.json",
16+
}

test/test-0.10.0.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import RNTest from './react-native-testkit/'
2+
import React from 'react'
3+
import RNFetchBlob from 'react-native-fetch-blob'
4+
import {
5+
StyleSheet,
6+
Text,
7+
View,
8+
ScrollView,
9+
Platform,
10+
Dimensions,
11+
Image,
12+
} from 'react-native';
13+
14+
window.XMLHttpRequest = RNFetchBlob.polyfill.XMLHttpRequest
15+
window.Blob = RNFetchBlob.polyfill.Blob
16+
window.fetch = new RNFetchBlob.polyfill.Fetch({
17+
auto : true,
18+
binaryContentTypes : ['image/', 'video/', 'audio/']
19+
}).build()
20+
21+
const fs = RNFetchBlob.fs
22+
const { Assert, Comparer, Info, prop } = RNTest
23+
const describe = RNTest.config({
24+
group : '0.10.0',
25+
run : true,
26+
expand : true,
27+
timeout : 20000,
28+
})
29+
const { TEST_SERVER_URL, TEST_SERVER_URL_SSL, FILENAME, DROPBOX_TOKEN, styles } = prop()
30+
const dirs = RNFetchBlob.fs.dirs
31+
32+
let prefix = ((Platform.OS === 'android') ? 'file://' : '')

0 commit comments

Comments
 (0)