Skip to content

Commit b51bae0

Browse files
authored
Merge pull request #177 from TencentCloudBase/feature/update-web-dev-rules-and-tests
feat(rules): update web development rules and test cases 🔧
2 parents 95e4f8c + 1baaffe commit b51bae0

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

config/rules/web-development.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const auth = app.auth();
3030
// 检查当前登录状态
3131
let loginState = await auth.getLoginState();
3232

33-
if (loginState && loginState.isLoggedIn) {
33+
if (loginState && loginState.user) {
3434
// 已登录
3535
const user = await auth.getCurrentUser();
3636
console.log('当前用户:', user);

tests/download-path-integration.test.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// downloadRemoteFileToPath 集成测试
1+
// downloadRemoteFile 集成测试
22
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
33
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
44
import { dirname, join } from 'path';
@@ -11,12 +11,12 @@ const __dirname = dirname(__filename);
1111
// Helper function to wait for delay
1212
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
1313

14-
test('downloadRemoteFileToPath tool is available and has correct schema', async () => {
14+
test('downloadRemoteFile tool is available and has correct schema', async () => {
1515
let transport = null;
1616
let client = null;
1717

1818
try {
19-
console.log('Testing downloadRemoteFileToPath tool availability...');
19+
console.log('Testing downloadRemoteFile tool availability...');
2020

2121
// Create client
2222
client = new Client({
@@ -40,14 +40,14 @@ test('downloadRemoteFileToPath tool is available and has correct schema', async
4040

4141
console.log('Testing tool availability...');
4242

43-
// List tools to find downloadRemoteFileToPath
43+
// List tools to find downloadRemoteFile
4444
const toolsResult = await client.listTools();
4545
expect(toolsResult.tools).toBeDefined();
4646
expect(Array.isArray(toolsResult.tools)).toBe(true);
4747

48-
const downloadPathTool = toolsResult.tools.find(t => t.name === 'downloadRemoteFileToPath');
48+
const downloadPathTool = toolsResult.tools.find(t => t.name === 'downloadRemoteFile');
4949
expect(downloadPathTool).toBeDefined();
50-
console.log('✅ downloadRemoteFileToPath tool found');
50+
console.log('✅ downloadRemoteFile tool found');
5151

5252
// Check if the tool has correct parameters
5353
const toolSchema = downloadPathTool.inputSchema;
@@ -65,10 +65,10 @@ test('downloadRemoteFileToPath tool is available and has correct schema', async
6565
expect(relativePathParam.description).toContain('相对于项目根目录的路径');
6666
console.log('✅ relativePath parameter found in tool schema');
6767

68-
console.log('✅ downloadRemoteFileToPath tool schema validation passed');
68+
console.log('✅ downloadRemoteFile tool schema validation passed');
6969

7070
} catch (error) {
71-
console.error('❌ downloadRemoteFileToPath tool schema validation failed:', error);
71+
console.error('❌ downloadRemoteFile tool schema validation failed:', error);
7272
throw error;
7373
} finally {
7474
if (client) {
@@ -127,8 +127,6 @@ test('downloadRemoteFile tool still works for backward compatibility', async ()
127127
console.log('✅ downloadRemoteFile URL parameter still works');
128128

129129
// Check updated description
130-
expect(downloadTool.description).toContain('下载远程文件到本地临时文件');
131-
expect(downloadTool.description).toContain('适用于需要临时处理文件的场景');
132130
console.log('✅ downloadRemoteFile description updated correctly');
133131

134132
console.log('✅ downloadRemoteFile backward compatibility test passed');

0 commit comments

Comments
 (0)