MCPcopy Create free account
hub / github.com/wonderwhy-er/DesktopCommanderMCP / testBasicSearch

Function testBasicSearch

test/test-search-code.js:200–218  ·  view source on GitHub ↗

* Test basic search functionality

()

Source from the content-addressed store, hash-verified

198 * Test basic search functionality
199 */
200async function testBasicSearch() {
201 console.log(`${colors.yellow}Testing basic search functionality...${colors.reset}`);
202
203 const { finalResult } = await searchAndWaitForCompletion({
204 path: TEST_DIR,
205 pattern: 'pattern',
206 searchType: 'content'
207 });
208
209 assert(finalResult.content, 'Result should have content');
210 assert(finalResult.content.length > 0, 'Content should not be empty');
211
212 const text = finalResult.content[0].text;
213 assert(text.includes('test1.js'), 'Should find matches in test1.js');
214 assert(text.includes('test2.ts'), 'Should find matches in test2.ts');
215 assert(text.includes('nested.py'), 'Should find matches in nested.py');
216
217 console.log(`${colors.green}✓ Basic search test passed${colors.reset}`);
218}
219
220/**
221 * Test case-sensitive search

Callers 1

testSearchCodeFunction · 0.85

Calls 3

logMethod · 0.80
assertFunction · 0.70

Tested by

no test coverage detected