Skip to content

test(cli-tools): add tests for formatters, prompts, and updateEnvFile#71

Open
ak68a wants to merge 2 commits intoagentcommercekit:mainfrom
ak68a:test/cli-tools
Open

test(cli-tools): add tests for formatters, prompts, and updateEnvFile#71
ak68a wants to merge 2 commits intoagentcommercekit:mainfrom
ak68a:test/cli-tools

Conversation

@ak68a
Copy link

@ak68a ak68a commented Mar 25, 2026

Summary

  • Add tests for all utility functions in tools/cli-tools/ which previously had zero test coverage
  • 20 tests across 3 files: formatters (10), update-env-file (6), prompts (4)

What's tested

formatters — sectionHeader divider width and step numbering, successMessage/errorMessage prefixes, wordWrap at custom and default widths, link URL preservation

update-env-file — create new .env, update existing keys in-place, append new keys, preserve comments/blank lines, multiple keys at once, values containing equals signs. Uses real temp directories, not mocks.

prompts — log with default wrapping, log with wrap disabled, logJson formatted output

Test plan

  • pnpm --filter ./tools/cli-tools test — 20 tests pass
  • pnpm run check — clean

ak68a added 2 commits March 25, 2026 17:02
Cover all utility functions that previously had zero tests:

formatters: sectionHeader divider width and step numbering,
successMessage/errorMessage prefixes, wordWrap at custom and
default widths, demoHeader/demoFooter non-empty output, link
URL preservation.

update-env-file: create new file, update existing keys in-place,
append new keys, preserve comments and blank lines, multiple keys,
values containing equals signs. Uses real temp directories.

prompts: log with default wrapping, log with wrap disabled,
logJson formatted output.
@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

Warning

Rate limit exceeded

@ak68a has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a1a56341-06f8-47c6-a283-51df50d4e793

📥 Commits

Reviewing files that changed from the base of the PR and between f0e8c6c and df57655.

📒 Files selected for processing (3)
  • tools/cli-tools/src/formatters.test.ts
  • tools/cli-tools/src/prompts.test.ts
  • tools/cli-tools/src/update-env-file.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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