let createSlackWebClient: typeofimport("./client.js").createSlackWebClient;
let createSlackWriteClient: typeofimport("./client.js").createSlackWriteClient;
let createSlackTokenCacheKey: typeofimport("./client.js").createSlackTokenCacheKey;
let getSlackWriteClient: typeofimport("./client.js").getSlackWriteClient;
let clearSlackWriteClientCacheForTest: typeofimport("./client.js").clearSlackWriteClientCacheForTest;
let resolveSlackWebClientOptions: typeofimport("./client.js").resolveSlackWebClientOptions;
let resolveSlackWriteClientOptions: typeofimport("./client.js").resolveSlackWriteClientOptions;
let SLACK_DEFAULT_RETRY_OPTIONS: typeofimport("./client.js").SLACK_DEFAULT_RETRY_OPTIONS;
let SLACK_WRITE_RETRY_OPTIONS: typeofimport("./client.js").SLACK_WRITE_RETRY_OPTIONS;
let WebClient: ReturnType<typeof vi.fn>;
it("falls back to HTTP_PROXY when HTTPS_PROXY is not set", () => {
process.env.HTTP_PROXY = "http://proxy.example.com:3128"; const options = resolveSlackWebClientOptions();
expect(options.agent).toBeDefined();
});
it("does not set agent when no proxy env var is configured", () => { const options = resolveSlackWebClientOptions();
expect(options.agent).toBeUndefined();
});
it("does not override an explicitly provided agent", () => {
process.env.HTTPS_PROXY = "http://proxy.example.com:3128"; const customAgent = {} as never; const options = resolveSlackWebClientOptions({ agent: customAgent });
expect(options.agent).toBeDefined(); // HttpsProxyAgent stores the proxy URL — verify it picked the lower-case one
expect((options.agent as unknown as { proxy: { href: string } }).proxy.href).toContain( "lower.example.com",
);
});
// Should not throw; falls back to no agent
expect(options.agent).toBeUndefined();
});
});
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.