mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
fix(adapter): fix progress event emitting; (#6518)
This commit is contained in:
@@ -1919,6 +1919,7 @@ describe('supports http with nodejs', function () {
|
||||
describe('progress', function () {
|
||||
describe('upload', function () {
|
||||
it('should support upload progress capturing', async function () {
|
||||
this.timeout(15000);
|
||||
server = await startHTTPServer({
|
||||
rate: 100 * 1024
|
||||
});
|
||||
@@ -1943,6 +1944,7 @@ describe('supports http with nodejs', function () {
|
||||
|
||||
const {data} = await axios.post(LOCAL_SERVER_URL, readable, {
|
||||
onUploadProgress: ({loaded, total, progress, bytes, upload}) => {
|
||||
console.log('onUploadProgress', loaded, '/', total);
|
||||
samples.push({
|
||||
loaded,
|
||||
total,
|
||||
@@ -1975,6 +1977,8 @@ describe('supports http with nodejs', function () {
|
||||
|
||||
describe('download', function () {
|
||||
it('should support download progress capturing', async function () {
|
||||
this.timeout(15000);
|
||||
|
||||
server = await startHTTPServer({
|
||||
rate: 100 * 1024
|
||||
});
|
||||
@@ -1999,6 +2003,7 @@ describe('supports http with nodejs', function () {
|
||||
|
||||
const {data} = await axios.post(LOCAL_SERVER_URL, readable, {
|
||||
onDownloadProgress: ({loaded, total, progress, bytes, download}) => {
|
||||
console.log('onDownloadProgress', loaded, '/', total);
|
||||
samples.push({
|
||||
loaded,
|
||||
total,
|
||||
@@ -2114,7 +2119,7 @@ describe('supports http with nodejs', function () {
|
||||
}]`
|
||||
);
|
||||
|
||||
const progressTicksRate = 2;
|
||||
const progressTicksRate = 3;
|
||||
const expectedProgress = ((i + skip) / secs) / progressTicksRate;
|
||||
|
||||
assert.ok(
|
||||
|
||||
Reference in New Issue
Block a user