Skip to content

test(utils): add tests for dim, italic and green color functions - #2294

Open
jxhhdx wants to merge 1 commit into
farm-fe:mainfrom
jxhhdx:test/color-utils-add-tests
Open

test(utils): add tests for dim, italic and green color functions#2294
jxhhdx wants to merge 1 commit into
farm-fe:mainfrom
jxhhdx:test/color-utils-add-tests

Conversation

@jxhhdx

@jxhhdx jxhhdx commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Add missing test coverage for color utility functions:

  • dim: should wrap with ansi code (\x1b[2m...\x1b[22m)
  • italic: should wrap with ansi code (\x1b[3m...\x1b[23m)
  • green: should wrap with ansi code (\x1b[32m...\x1b[39m)

Description:

BREAKING CHANGE:

Related issue (if exists):

Summary by CodeRabbit

  • Tests
    • Added comprehensive unit tests for color formatting utilities to verify proper ANSI escape sequence handling across dim, italic, and green color functions.

Add missing test coverage for color utility functions:
- dim: should wrap with ansi code (\x1b[2m...\x1b[22m)
- italic: should wrap with ansi code (\x1b[3m...\x1b[23m)
- green: should wrap with ansi code (\x1b[32m...\x1b[39m)
@vercel

vercel Bot commented Apr 8, 2026

Copy link
Copy Markdown

@jxhhdx is attempting to deploy a commit to the Farm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Apr 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 305fdef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "farm-docs" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "bench" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 69ff51b0-cf3a-4a7f-a772-71ebfb0056aa

📥 Commits

Reviewing files that changed from the base of the PR and between 198bb3b and 305fdef.

📒 Files selected for processing (1)
  • packages/utils/tests/color.spec.ts

📝 Walkthrough

Walkthrough

The test suite for color utility functions now imports and validates three new formatting helpers—dim, italic, and green—that wrap text with ANSI escape sequences. Unit tests confirm each function applies the correct escape codes and reset sequences.

Changes

Cohort / File(s) Summary
Color Function Tests
packages/utils/tests/color.spec.ts
Added imports and unit tests for dim, italic, and green formatting helpers, verifying correct ANSI escape sequence wrapping (\x1b[2m...\x1b[22m, \x1b[3m...\x1b[23m, \x1b[32m...\x1b[39m).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three colors dance in ANSI's glow,
Dim, italic, green in a row!
With escape codes tight and resets so right,
Our test suite shines with fluorescent light! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and accurately describes the main change: adding tests for three color utility functions (dim, italic, and green).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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