src/RESTController.js
changed.
Other files ignored by Codecov
src/__tests__/RESTController-test.js
has changed.
src/__tests__/test_helpers/mockXHR.js
has changed.
169 | 169 | headers[key] = customHeaders[key]; |
|
170 | 170 | } |
|
171 | 171 | ||
172 | - | function handleProgress(type, event) { |
|
173 | - | if (options && typeof options.progress === 'function') { |
|
172 | + | if (options && typeof options.progress === 'function') { |
|
173 | + | const handleProgress = function (type, event) { |
|
174 | 174 | if (event.lengthComputable) { |
|
175 | 175 | options.progress(event.loaded / event.total, event.loaded, event.total, { type }); |
|
176 | 176 | } else { |
|
177 | 177 | options.progress(null, null, null, { type }); |
|
178 | 178 | } |
|
179 | - | } |
|
180 | - | } |
|
181 | - | ||
182 | - | xhr.onprogress = event => { |
|
183 | - | handleProgress('download', event); |
|
184 | - | }; |
|
179 | + | }; |
|
185 | 180 | ||
186 | - | if (xhr.upload) { |
|
187 | - | xhr.upload.onprogress = event => { |
|
188 | - | handleProgress('upload', event); |
|
181 | + | xhr.onprogress = event => { |
|
182 | + | handleProgress('download', event); |
|
189 | 183 | }; |
|
184 | + | ||
185 | + | if (xhr.upload) { |
|
186 | + | xhr.upload.onprogress = event => { |
|
187 | + | handleProgress('upload', event); |
|
188 | + | }; |
|
189 | + | } |
|
190 | 190 | } |
|
191 | 191 | ||
192 | 192 | xhr.open(method, url, true); |
Files | Coverage |
---|---|
src | 99.90% |
Project Totals (61 files) | 99.90% |