Skip to content

Commit

Permalink
chore: address nit
Browse files Browse the repository at this point in the history
  • Loading branch information
maliroteh-sf committed May 30, 2024
1 parent 9ee713d commit 279fff7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/unit/common/CommonUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,15 @@ describe('CommonUtils', () => {
}

async function verifyDownloadFails(url: string, mockResponse: any) {
const fake = (options: any, callback: (res: http.IncomingMessage) => void) => {
setTimeout(() => callback(mockResponse), 100);
return { on: () => {}, end: () => {} };
};

if (url.startsWith('https:')) {
httpsGetStub.callsFake((_, callback) => {
setTimeout(() => callback(mockResponse), 100);
return { on: () => {}, end: () => {} };
});
httpsGetStub.callsFake(fake);
} else {
httpGetStub.callsFake((_, callback) => {
setTimeout(() => callback(mockResponse), 100);
return { on: () => {}, end: () => {} };
});
httpGetStub.callsFake(fake);
}

try {
Expand Down

0 comments on commit 279fff7

Please sign in to comment.