mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
🧪 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:
parent
e192c99c7d
commit
f1c6e4d55e
2 changed files with 1260 additions and 7 deletions
1259
api/server/routes/__tests__/mcp.spec.js
Normal file
1259
api/server/routes/__tests__/mcp.spec.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue