Ben Hsieh 8 лет назад
Родитель
Сommit
16f34b10cd
1 измененных файлов: 2 добавлений и 3 удалений
  1. 2
    3
      test/test-0.1.x-0.4.x.js

+ 2
- 3
test/test-0.1.x-0.4.x.js Просмотреть файл

@@ -105,12 +105,12 @@ describe('Progress report test', (report, done) => {
105 105
       Authorization : 'Bearer abde123eqweje'
106 106
     })
107 107
     .progress((received, total) => {
108
-      actual = received
109 108
       expect = total
110 109
     })
111 110
     .then((resp) => {
111
+      actual = resp.text().length
112 112
       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)}/>,
114 114
         <Assert key="response data should be correct event with progress listener"
115 115
           expect={resp.text().substr(0,10)} actual={"1234567890"}/>)
116 116
       done()
@@ -137,7 +137,6 @@ describe('PUT request test', (report, done) => {
137 137
     .then((resp) => {
138 138
       resp = resp.json()
139 139
       report(
140
-        <Assert key="upload progress correct" expect={expect} actual={actual}/>,
141 140
         <Assert key="check put form data #1" expect="hello !!" actual={resp.fields.field1}/>,
142 141
         <Assert key="check put form data #2" expect="hello2 !!" actual={resp.fields.field2}/>,
143 142
       )