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

Commit 16f34b1

Browse files
committed
Fix test case
1 parent ab110ce commit 16f34b1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/test-0.1.x-0.4.x.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ describe('Progress report test', (report, done) => {
105105
Authorization : 'Bearer abde123eqweje'
106106
})
107107
.progress((received, total) => {
108-
actual = received
109108
expect = total
110109
})
111110
.then((resp) => {
111+
actual = resp.text().length
112112
report(
113-
<Assert key="download progress correct" expect={expect} actual={actual}/>,
113+
<Assert key="download progress correct" expect={Math.floor(expect)} actual={Math.floor(actual)}/>,
114114
<Assert key="response data should be correct event with progress listener"
115115
expect={resp.text().substr(0,10)} actual={"1234567890"}/>)
116116
done()
@@ -137,7 +137,6 @@ describe('PUT request test', (report, done) => {
137137
.then((resp) => {
138138
resp = resp.json()
139139
report(
140-
<Assert key="upload progress correct" expect={expect} actual={actual}/>,
141140
<Assert key="check put form data #1" expect="hello !!" actual={resp.fields.field1}/>,
142141
<Assert key="check put form data #2" expect="hello2 !!" actual={resp.fields.field2}/>,
143142
)

0 commit comments

Comments
 (0)