Skip to content

test: add 12 tests for config module - #19

Closed
TerminalGravity wants to merge 2 commits into
mainfrom
test/config-module
Closed

test: add 12 tests for config module#19
TerminalGravity wants to merge 2 commits into
mainfrom
test/config-module

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

Adds comprehensive test coverage for src/lib/config.ts — previously untested.

Covers:

  • Default config when no .preflight/ dir or env vars
  • Env var fallback (profile, related projects, embedding provider)
  • .preflight/config.yml loading + merge with defaults
  • .preflight/triage.yml loading + partial rule merge
  • Env vars ignored when .preflight/ directory exists
  • Malformed YAML graceful fallback
  • hasPreflightConfig() and getRelatedProjects() helpers
  • Invalid env var values rejected

All 94 tests pass (82 existing + 12 new).

Export pure helper functions (estimateTokens, extractText, extractToolNames,
formatTokens, formatCost, formatDuration, PRICING, CORRECTION_SIGNALS) and
add comprehensive unit tests covering edge cases, boundary conditions, and
correction signal regex accuracy.

Test suite: 43 → 82 tests.
@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Superseded by #28 which includes resetConfig() and more comprehensive tests.

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