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

Commit 008d754

Browse files
committed
Add test case for #159
1 parent 04802df commit 008d754

File tree

1 file changed

+40
-24
lines changed

1 file changed

+40
-24
lines changed

test/test-0.10.0.js

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,46 @@ let begin = Date.now()
8989
//
9090
// })
9191

92-
describe('#154 Allow passing unparsed response body to error handler ', (report, done) =>{
93-
94-
RNFetchBlob.fetch('get', `${TEST_SERVER_URL}/err-body`)
95-
.then((res) => {
96-
console.log(res)
97-
})
98-
.catch((err) => {
99-
console.log(err)
100-
})
101-
102-
})
103-
104-
describe('cookie test', (report, done) => {
92+
// describe('#154 Allow passing unparsed response body to error handler ', (report, done) =>{
93+
//
94+
// RNFetchBlob.fetch('get', `${TEST_SERVER_URL}/err-body`)
95+
// .then((res) => {
96+
// console.log(res)
97+
// })
98+
// .catch((err) => {
99+
// console.log(err)
100+
// })
101+
//
102+
// })
103+
//
104+
// describe('cookie test', (report, done) => {
105+
//
106+
// RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/cookie`)
107+
// .then((res) => {
108+
// return RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/xhr-header`)
109+
// })
110+
// .then((res) => {
111+
// console.log(res)
112+
// RNFetchBlob.net.getCookies(`${TEST_SERVER_URL}`)
113+
// .then((cookies) => {
114+
// console.log(cookies)
115+
// })
116+
// })
117+
//
118+
// })
105119

106-
RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/cookie`)
107-
.then((res) => {
108-
return RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/xhr-header`)
109-
})
110-
.then((res) => {
111-
console.log(res)
112-
RNFetchBlob.net.getCookies(`${TEST_SERVER_URL}`)
113-
.then((cookies) => {
114-
console.log(cookies)
120+
describe('SSL test #159', (report, done) => {
121+
RNFetchBlob.config({
122+
trusty : true
123+
}).fetch('GET', `${TEST_SERVER_URL_SSL}/public/github.png`, {
124+
'Cache-Control' : 'no-store'
125+
})
126+
.then(res => {
127+
report(<Assert key="trusty request should pass" expect={true} actual={true}/>)
128+
return RNFetchBlob.fetch('GET',`${TEST_SERVER_URL_SSL}/public/github.png`)
129+
})
130+
.catch(e => {
131+
report(<Assert key="non-trusty request should not pass" expect={true} actual={true}/>)
132+
done()
115133
})
116-
})
117-
118134
})

0 commit comments

Comments
 (0)