Browse Source

Fix test case

Ben Hsieh 8 years ago
parent
commit
16f34b10cd
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      test/test-0.1.x-0.4.x.js

+ 2
- 3
test/test-0.1.x-0.4.x.js View File

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