Skip to content

refactor(tests): align test files with unit testing rubric - #84

Merged
2witstudios merged 1 commit into
masterfrom
claude/add-unit-tests-lib-modules-feEZG
Dec 15, 2025
Merged

2witstudios merged 1 commit into
masterfrom
claude/add-unit-tests-lib-modules-feEZG

Conversation

@2witstudios

Copy link
Copy Markdown
Owner
  • ai-tools.test.ts: Add @scaffold label, replace brittle key counting with spread-equality assertion, add collision detection test
  • page-write-tools.test.ts: Remove weak "only called" assertion, rely on observable outcomes (result.success, result.linesReplaced)
  • mcp-bridge.test.ts: Remove call count assertion, keep payload assertions
  • drive-tools.test.ts: Remove unused chain mocks, add @scaffold note with TODO for DriveRepository seam
  • search-tools.test.ts: Remove unused chain mocks, add @scaffold note with TODO for SearchService seam

These changes follow the unit testing rubric principles:

  • Test observable outcomes, not internal mechanics
  • Mock only at boundary seams
  • Label scaffold/aggregation tests appropriately
  • Document deferred happy path coverage with seam proposals

- ai-tools.test.ts: Add @scaffold label, replace brittle key counting
  with spread-equality assertion, add collision detection test
- page-write-tools.test.ts: Remove weak "only called" assertion,
  rely on observable outcomes (result.success, result.linesReplaced)
- mcp-bridge.test.ts: Remove call count assertion, keep payload assertions
- drive-tools.test.ts: Remove unused chain mocks, add @scaffold note
  with TODO for DriveRepository seam
- search-tools.test.ts: Remove unused chain mocks, add @scaffold note
  with TODO for SearchService seam

These changes follow the unit testing rubric principles:
- Test observable outcomes, not internal mechanics
- Mock only at boundary seams
- Label scaffold/aggregation tests appropriately
- Document deferred happy path coverage with seam proposals
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Dec 14, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 59 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.

📥 Commits

Reviewing files that changed from the base of the PR and between fad40b1 and a387e2d.

📒 Files selected for processing (5)
  • apps/web/src/lib/ai/core/__tests__/ai-tools.test.ts (2 hunks)
  • apps/web/src/lib/ai/tools/__tests__/drive-tools.test.ts (2 hunks)
  • apps/web/src/lib/ai/tools/__tests__/page-write-tools.test.ts (1 hunks)
  • apps/web/src/lib/ai/tools/__tests__/search-tools.test.ts (2 hunks)
  • apps/web/src/lib/mcp/__tests__/mcp-bridge.test.ts (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/add-unit-tests-lib-modules-feEZG

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

@2witstudios

Copy link
Copy Markdown
Owner Author

@coderabbitai help

@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
    • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
    • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit configuration file (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@2witstudios

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@2witstudios

Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Reviews resumed.

@2witstudios
2witstudios merged commit 2044b21 into master Dec 15, 2025
3 checks passed
@2witstudios
2witstudios deleted the claude/add-unit-tests-lib-modules-feEZG branch January 29, 2026 02:30
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.

2 participants