Skip to content

Conversation

@gitauto-ai
Copy link
Contributor

@gitauto-ai gitauto-ai bot commented Dec 1, 2025

Resolves #1994

Summary

Add comprehensive unit tests for services/github/files/get_eslint_config.py to validate ESLint config discovery and error handling, achieving 100% line/statement/function coverage and exercising the previously uncovered conditional branch.

Test Patterns

  • Config discovery across common locations:
    • package.json eslintConfig
    • .eslintrc.json
    • .eslintrc.yml/.yaml
  • Absence of any config returns expected “not found” result
  • Malformed content handling:
    • Invalid JSON in .eslintrc.json
    • Invalid YAML in .eslintrc.yml/.yaml
    • Empty file content
    • Non-UTF8/binary content
  • GitHub retrieval edge cases:
    • 404 (file not found)
    • 403 (permission/rate-limited)
    • 5xx (server error)
  • Ref/branch handling:
    • Specific ref provided vs default branch
    • Missing path/ref combinations
  • Precedence/selection when multiple configs are present
  • Ensures both truthy and falsy paths of the conditional at line 38 are exercised (previously uncovered branch)
git fetch origin
git checkout gitauto/issue-1994-20251201-000524-lJPH
git pull origin gitauto/issue-1994-20251201-000524-lJPH

@gitauto-ai gitauto-ai bot requested a review from hiroshinishio as a code owner December 1, 2025 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schedule: Add unit tests to services/github/files/get_eslint_config.py

1 participant