Commit Graph

4 Commits

Author SHA1 Message Date
Kazuki Yamada
ea1cc485c2 chore(config): disable organizeImports for src/index.ts
Added override configuration to disable Biome's organizeImports feature
specifically for src/index.ts to allow manual import order management
while keeping automatic import organization enabled for other files.
2025-09-21 13:54:12 +09:00
Kazuki Yamada
d5c5cd8bdc test(git): Update gitHubArchive test to use HEAD instead of main
Update the test expectation to reflect the change from hardcoded 'main'
branch to using HEAD for the repository's default branch.
2025-08-26 01:01:01 +09:00
Kazuki Yamada
9708e1cf38 perf(test): Optimize gitHubArchive test execution time
Reduced test execution time from ~23s to ~3.5s (85% improvement) by:

- Reduced retry counts from 3 to 1-2 for error handling tests
- Shortened timeout values (100ms → 50ms) for timeout tests
- Removed unnecessary imports (createWriteStream, fs, Readable, pipeline)
- Fixed unused parameter warnings with underscore prefix (_data)

Performance improvements:
- "should retry on failure": 3005ms → 1002ms
- "should throw error after all retries fail": 2007ms → 2005ms (minor)
- "should handle ZIP extraction error": 6011ms → 3ms
- "should handle timeout": 408ms → 208ms
- Other error tests: 6000ms+ → 1-3ms each

The tests still validate all critical functionality including:
 Retry logic and exponential backoff behavior
 Error handling for network/ZIP failures
 Security protections and edge cases
 Timeout handling mechanisms

Trade-off: Slightly reduced retry testing depth for much faster CI/development cycles.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 00:20:43 +09:00
Kazuki Yamada
f4f911e637 test(git): Add comprehensive test suite for gitHubArchive.ts
Created thorough unit tests covering all functionality of the GitHub archive
download and extraction module. Tests include:

- Successful download and extraction flow
- Progress callback handling
- Retry logic with exponential backoff
- URL fallback strategies (main → master → tag)
- Error handling for network failures, ZIP corruption, timeouts
- Security validations for path traversal and absolute paths
- Archive cleanup on both success and failure
- Multiple response scenarios (404, timeout, missing body)

Test coverage includes:
- downloadGitHubArchive function with various scenarios
- isArchiveDownloadSupported function
- All edge cases and error conditions
- Security protection mechanisms

Uses proper mocking with vitest for external dependencies:
- fetch API for HTTP requests
- fflate library for ZIP extraction
- Node.js fs operations
- Stream processing components

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 00:15:10 +09:00