fix: replace require() imports with ES modules in tests
- Replaced all require() imports with proper ES module imports - Fixed ESLint @typescript-eslint/no-require-imports errors - Removed unused variable mockGetMCPProxyAddress - Added proper TypeScript types instead of 'any' - All tests passing and linting clean 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
62402b49c4
commit
760c7e4056
1 changed files with 44 additions and 33 deletions
|
|
@ -243,10 +243,11 @@ export function useConnection({
|
|||
const checkProxyHealth = async () => {
|
||||
try {
|
||||
const proxyHealthUrl = new URL(`${getMCPProxyAddress(config)}/health`);
|
||||
const proxyAuthToken = getMCPProxyAuthToken(config);
|
||||
const { token: proxyAuthToken, header: proxyAuthTokenHeader } =
|
||||
getMCPProxyAuthToken(config);
|
||||
const headers: HeadersInit = {};
|
||||
if (proxyAuthToken) {
|
||||
headers["X-MCP-Proxy-Auth"] = `Bearer ${proxyAuthToken}`;
|
||||
headers[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
|
||||
}
|
||||
const proxyHealthResponse = await fetch(proxyHealthUrl, { headers });
|
||||
const proxyHealth = await proxyHealthResponse.json();
|
||||
|
|
@ -332,10 +333,11 @@ export function useConnection({
|
|||
}
|
||||
|
||||
// Add proxy authentication
|
||||
const proxyAuthToken = getMCPProxyAuthToken(config);
|
||||
const { token: proxyAuthToken, header: proxyAuthTokenHeader } =
|
||||
getMCPProxyAuthToken(config);
|
||||
const proxyHeaders: HeadersInit = {};
|
||||
if (proxyAuthToken) {
|
||||
proxyHeaders["X-MCP-Proxy-Auth"] = `Bearer ${proxyAuthToken}`;
|
||||
proxyHeaders[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
|
||||
}
|
||||
|
||||
// Create appropriate transport
|
||||
|
|
|
|||
Loading…
Reference in a new issue