Skip to content

test: add unit tests for OptionResolver#62

Open
MaxwellCalkin wants to merge 3 commits intosensay-io:mainfrom
MaxwellCalkin:test/option-resolver-unit-tests
Open

test: add unit tests for OptionResolver#62
MaxwellCalkin wants to merge 3 commits intosensay-io:mainfrom
MaxwellCalkin:test/option-resolver-unit-tests

Conversation

@MaxwellCalkin
Copy link
Copy Markdown

Summary

  • Adds 18 unit tests for the OptionResolver utility class
  • Covers the full priority chain (CLI > env > project config > user config > default)
  • Tests silent/non-interactive mode, interactive prompting, save option behavior, and config loading
  • Partially addresses Missing end-to-end tests for all commands #4 (missing e2e/unit tests)

Test plan

  • All 18 tests pass: npx jest tests/option-resolver.test.ts
  • Verify tests pass in CI

🤖 Generated with Claude Code

MaxwellCalkin and others added 3 commits March 7, 2026 15:33
Creates a reusable OptionResolver class that handles the standard
configuration priority chain (CLI → ENV → Interactive → Project → User)
as specified in CLAUDE.md. Adds global --silent/-s option that skips
interactive prompts and uses config defaults.

Refactors chat and simple-organization-setup commands to use
OptionResolver, eliminating duplicated config resolution logic.

Closes sensay-io#2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…roject config

When --save is passed, options resolved via interactive prompts that aren't
already in the project config are saved to sensay.config.json after resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 tests covering priority chain, silent mode, interactive mode,
save option behavior, and config loading. Validates the complete
resolution logic introduced in the OptionResolver class.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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