Skip to content

test: improve test coverage to 98.57% functions and 100% lines#2

Merged
amondnet merged 1 commit into
mainfrom
test/improve-coverage
Oct 30, 2025
Merged

test: improve test coverage to 98.57% functions and 100% lines#2
amondnet merged 1 commit into
mainfrom
test/improve-coverage

Conversation

@amondnet

Copy link
Copy Markdown
Contributor

Summary

  • Improved function coverage from 77.96% to 98.57% (+20.61%)
  • Achieved 100% line coverage (up from 83.27%, +16.73%)
  • Added 59 new tests across 5 new test files

Changes

  • Added comprehensive tests for outputJson() and outputData() in test/output/json.test.ts
  • Created test/output/toon.test.ts with full coverage for TOON encoding and output
  • Created test/progress/console.test.ts for progress indicator functionality
  • Created test/progress/formatters.test.ts for all message formatting functions
  • Created test/i18n/common.test.ts for internationalization common messages
  • Enhanced test/i18n/manager.test.ts with additional edge cases

Test Results

  • 132 tests passing (up from 73)
  • 0 failures
  • 204 expect() calls

Coverage Details

All source files now have 100% line coverage:

  • src/output/json.ts: 100%/100%
  • src/output/toon.ts: 100%/100%
  • src/progress/console.ts: 100%/100%
  • src/progress/formatters.ts: 100%/100%
  • src/i18n/common.ts: 100%/100%
  • src/i18n/manager.ts: 85.71%/100%
  • All validation and other modules: 100%/100%

Add comprehensive test coverage for previously untested modules:
- Add tests for outputJson and outputData functions in json.test.ts
- Create toon.test.ts for TOON format encoding and output
- Create console.test.ts for progress indicator functionality
- Create formatters.test.ts for message formatting functions
- Create common.test.ts for i18n common messages
- Enhance manager.test.ts with additional test cases

Coverage improvements:
- Function coverage: 77.96% → 98.57% (+20.61%)
- Line coverage: 83.27% → 100% (+16.73%)
- Test count: 73 → 132 tests (+59 tests)
@codecov

codecov Bot commented Oct 30, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@amondnet
amondnet merged commit b4d40f2 into main Oct 30, 2025
2 checks passed
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