Skip to content

fix: added ANSI char escape for tests that fail with database disabled - #8635

Open
paulleephp wants to merge 1 commit into
netlify:mainfrom
paulleephp:fix/test-ansi-text-match
Open

paulleephp wants to merge 1 commit into
netlify:mainfrom
paulleephp:fix/test-ansi-text-match

Conversation

@paulleephp

@paulleephp paulleephp commented Oct 18, 2026 •

Copy link
Copy Markdown

Summary

Fixes #8634

DB status unit test is failing if database is not set up. Added strip-ansi calls to remove the ANSI escape characters

@paulleephp
paulleephp requested a review from a team as a code owner October 18, 2026 09:23
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 562d27ea-82d5-4a1b-a029-07ac7e81f098
📥 Commits

Reviewing files that changed from the base of the PR and between 20e0b51 and 268bfc5.

📒 Files selected for processing: 1
  • tests/unit/commands/database/db-status.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Tests
    • Updated database status tests to ignore terminal color codes when checking output.

The database status tests import strip-ansi and apply it to assertions for the disabled-database install hint and installed-package statement. The expected text remains unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: eduardoboucas

Merge Risk: ⚪ Minimal · up to 268bf

The change adjusts database-status tests to ignore terminal styling while checking the same messages. No actionable merge risk remains.

Architecture risk: 🔵 Low · up to 268bf

The change affects 1 system.

Changed systems: tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in tests/unit/commands/database/db-status.test.ts: Added the strip-ansi import for use in output assertions.
  • observed — Modified behavior in tests/unit/commands/database/db-status.test.ts: Updated the install-hint and installed-package output assertions to strip ANSI formatting before checking their existing expected text.
Pre-merge checks: Passed 5
Check name Status Explanation
Linked Issues check Passed Issue [#8634] requires the db-status tests to pass when the database is disabled and status output contains ANSI formatting. This pull request applies stripAnsi to the two affected output assertio…
Out of Scope Changes check Passed The reviewed change is limited to tests/unit/commands/database/db-status.test.ts. It adds ANSI normalization to the two assertions identified by issue [#8634]. No unrelated production behavior or un…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Description check Passed The description clearly states that the database status unit test fails when the database is disabled and that the change adds strip-ansi calls to remove ANSI escape characters.
Title check Passed The title identifies the ANSI escape handling added to fix database-disabled test failures. It accurately summarizes the main change.
Full details: Linked Issues check

Explanation

Issue [#8634] requires the db-status tests to pass when the database is disabled and status output contains ANSI formatting. This pull request applies stripAnsi to the two affected output assertions. The expected text remains unchanged, so the assertions compare the status message without ANSI escape codes.

Full details: Out of Scope Changes check

Explanation

The reviewed change is limited to tests/unit/commands/database/db-status.test.ts. It adds ANSI normalization to the two assertions identified by issue [#8634]. No unrelated production behavior or unrelated test behavior is changed.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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.

db-status.test fails if the database is disabled

1 participant