Skip to content

test: add comprehensive tests for config module - #60

Closed
TerminalGravity wants to merge 1 commit into
mainfrom
test/config-module-tests
Closed

test: add comprehensive tests for config module#60
TerminalGravity wants to merge 1 commit into
mainfrom
test/config-module-tests

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

Adds 11 tests for src/lib/config.ts — previously untested.

Coverage:

  • Default config when no .preflight/ dir exists
  • config.yml loading (profile, related_projects, thresholds, embeddings)
  • triage.yml loading (strictness, rules)
  • Env var fallbacks (PROMPT_DISCIPLINE_PROFILE, PREFLIGHT_RELATED, EMBEDDING_PROVIDER)
  • Env vars ignored when .preflight/ dir exists
  • Malformed YAML graceful handling
  • Empty config file graceful handling
  • hasPreflightConfig() true/false cases

Brings test count from 43 → 54.

- 11 tests covering config.yml loading, triage.yml loading, env var fallbacks,
  .preflight/ directory precedence, malformed YAML handling, and hasPreflightConfig
- Tests use temp directories and vi.resetModules() to bypass config singleton
- Covers edge cases: empty YAML, missing dir, env var ignored when .preflight/ exists

@TerminalGravity TerminalGravity left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to finally have config module coverage. The edge cases around missing .preflight/ dir and partial config.yml are important. CI green, ready to merge.

@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Closing — superseded by newer PRs.

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.

1 participant