🧪 ci: Unit Tests for MCP Routes (#8803)

* refactor: remove unreachable if checks from mcp routes

* test: add tests for mcp routes
This commit is contained in:
Dustin Healy 2025-08-01 11:47:00 -07:00 committed by GitHub
parent e192c99c7d
commit f1c6e4d55e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1260 additions and 7 deletions

File diff suppressed because it is too large Load diff

View file

@ -337,9 +337,7 @@ router.post('/:serverName/reinitialize', requireJwtAuth, async (req, res) => {
for (const varName of Object.keys(serverConfig.customUserVars)) { for (const varName of Object.keys(serverConfig.customUserVars)) {
try { try {
const value = await getUserPluginAuthValue(user.id, varName, false); const value = await getUserPluginAuthValue(user.id, varName, false);
if (value) { customUserVars[varName] = value;
customUserVars[varName] = value;
}
} catch (err) { } catch (err) {
logger.error(`[MCP Reinitialize] Error fetching ${varName} for user ${user.id}:`, err); logger.error(`[MCP Reinitialize] Error fetching ${varName} for user ${user.id}:`, err);
} }
@ -504,10 +502,6 @@ router.get('/connection/status/:serverName', requireJwtAuth, async (req, res) =>
return res.status(401).json({ error: 'User not authenticated' }); return res.status(401).json({ error: 'User not authenticated' });
} }
if (!serverName) {
return res.status(400).json({ error: 'Server name is required' });
}
const { mcpConfig, appConnections, userConnections, oauthServers } = await getMCPSetupData( const { mcpConfig, appConnections, userConnections, oauthServers } = await getMCPSetupData(
user.id, user.id,
); );