mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 00:15:23 +02:00
fix: update proxy handling in GraphApiService tests
This commit is contained in:
parent
b342ce0191
commit
0228e37fc7
1 changed files with 2 additions and 4 deletions
|
|
@ -52,6 +52,7 @@ describe('GraphApiService', () => {
|
|||
afterEach(() => {
|
||||
// Clean up environment variables
|
||||
delete process.env.OPENID_GRAPH_SCOPES;
|
||||
delete process.env.PROXY;
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
@ -813,7 +814,6 @@ describe('GraphApiService', () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
process.env = { ...originalEnv };
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
|
@ -851,7 +851,7 @@ describe('GraphApiService', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it('should pass correct proxy URL to ProxyAgent', async () => {
|
||||
it('should create ProxyAgent dispatcher for any configured proxy URL', async () => {
|
||||
const proxyUrl = 'http://custom-proxy.example.com:3128';
|
||||
process.env.PROXY = proxyUrl;
|
||||
mockTokensCache.get.mockResolvedValue(null);
|
||||
|
|
@ -860,8 +860,6 @@ describe('GraphApiService', () => {
|
|||
|
||||
const initCall = Client.init.mock.calls[0][0];
|
||||
expect(initCall.fetchOptions.dispatcher).toBeInstanceOf(ProxyAgent);
|
||||
// ProxyAgent is initialized with the proxy URL
|
||||
expect(initCall.fetchOptions.dispatcher).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue