Open
Conversation
Add tests for critical components to improve code quality and catch regressions early. **Config package tests (84% coverage):** - ConfigDir/ConfigPath path construction - Load from environment variable - Load from config file - Save and reload config - Empty token validation - Invalid JSON handling - File permission verification (0600/0700) **API client tests:** - JSON parsing for all data types (Task, Project, Section, Label, etc.) - Request/response parameter serialization - Priority conversion logic (user 1-4 to API 4-1) - Case-insensitive project name matching **Output format tests (92% coverage):** - All output methods (tasks, projects, labels, sections, comments) - Empty list handling - JSON envelope format - Priority/due date/label formatting - Project markers (favorite, inbox) - Orphaned subtask handling - Error/success messages (human and JSON modes) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add tests for critical components to improve code quality and catch regressions early.
Test Coverage
internal/configinternal/outputinternal/apiTotal: 46 new tests
Details
Config package tests
TestConfigDir/TestConfigPath- Path constructionTestLoadFromEnvVar- Environment variable loadingTestLoadNoConfig- Missing config error handlingTestSaveAndLoad- Round-trip save/loadTestLoadEmptyToken- Empty token validationTestLoadInvalidJSON- Malformed JSON handlingTestGetToken- Token retrievalTestConfigDirPermissions- Directory permissions (0700)API client tests
Output format tests
Test plan
go test ./...)go test ./... -cover)🤖 Generated with Claude Code