Skip to content

Commit

Permalink
Fix broken unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
  • Loading branch information
rudyflores committed Dec 13, 2024
1 parent 7894ac2 commit cd5b2cf
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1502,22 +1502,6 @@ describe("AbstractRestClient tests", () => {
const result = privateRestClient.buildOptions(resource, request, reqHeaders);
expect(Object.keys(result)).toContain('agent');
});

it('Should use session proxy options over env vars for proxy agent', () => {
restSession.ISession.proxy = { proxy_authorization: 'proxy_auth_string'};
const resource = '/resource';
const request = '';
const reqHeaders: any[] = [];
const url = new URL('https://www.zowe.com');
const proxyAgent = new HttpsProxyAgent(url, { rejectUnauthorized: true });
getSystemProxyUrlSpy.mockReturnValue(url);
getProxyAgentSpy.mockReturnValue(proxyAgent);
setCertPemAuthSpy.mockReturnValue(true);
const headerSpy = jest.spyOn(privateRestClient, "appendHeaders");
const result = privateRestClient.buildOptions(resource, request, reqHeaders);
expect(Object.keys(result)).toContain('agent');
expect(headerSpy).toHaveBeenCalledWith([{'Proxy-Authorization': restSession.ISession.proxy.proxy_authorization}]);
});
});
});
});

0 comments on commit cd5b2cf

Please sign in to comment.