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

Function testIncludeHidden

test/test-search-code.js:336–360  ·  view source on GitHub ↗

* Test hidden files inclusion

()

Source from the content-addressed store, hash-verified

334 * Test hidden files inclusion
335 */
336async function testIncludeHidden() {
337 console.log(`${colors.yellow}Testing hidden files inclusion...${colors.reset}`);
338
339 // First, create a hidden file (starts with dot)
340 const hiddenFile = path.join(TEST_DIR, '.hidden-file.txt');
341 await fs.writeFile(hiddenFile, 'This is hidden content with pattern');
342
343 try {
344 const { finalResult } = await searchAndWaitForCompletion({
345 path: TEST_DIR,
346 pattern: 'hidden content',
347 searchType: 'content',
348 includeHidden: true
349 });
350
351 const text = finalResult.content[0].text;
352 const hasHiddenResults = text.includes('.hidden-file.txt') || text.includes('No matches found');
353 assert(hasHiddenResults, 'Should handle hidden files when includeHidden is true');
354
355 console.log(`${colors.green}✓ Include hidden files test passed${colors.reset}`);
356 } finally {
357 // Clean up hidden file
358 await fs.rm(hiddenFile, { force: true });
359 }
360}
361
362/**
363 * Test timeout functionality

Callers 1

testSearchCodeFunction · 0.85

Calls 3

logMethod · 0.80
assertFunction · 0.70

Tested by

no test coverage detected