* Test hidden files inclusion
()
| 334 | * Test hidden files inclusion |
| 335 | */ |
| 336 | async 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 |
no test coverage detected