Skip to content

Commit

Permalink
Update tÃests
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 committed Jan 3, 2023
1 parent 30b942f commit 7bf0a34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api-request-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class APIRequestManager {
var requestConfig = this.config.extend({
request: options,
});
var passThrough = new PassThrough();

// Make the request
var apiRequest = new APIRequest(requestConfig, this.eventBus);
Expand All @@ -86,6 +85,7 @@ class APIRequestManager {
// If the stream is undefined, then the request failed and we should
// propagate the error.
if (stream) {
var passThrough = new PassThrough();
stream.pipe(passThrough);
return passThrough;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_test/__tests__/file.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ test('test get file by stream with delay read', async() => {
let stream = await context.client.files.getReadStream(testFile.id);
// delay 3s to read the stream
// eslint-disable-next-line promise/avoid-new
await new Promise(resolve => setTimeout(resolve, 3000));
await new Promise(resolve => setTimeout(resolve, 500));
// eslint-disable-next-line promise/avoid-new
let buffer = await new Promise((resolve, reject) => {
let chunks = [];
Expand Down

0 comments on commit 7bf0a34

Please sign in to comment.