Skip to content

refactor: consolidate riteway test helpers#781

Open
2witstudios wants to merge 1 commit intomasterfrom
refactor/consolidate-riteway
Open

refactor: consolidate riteway test helpers#781
2witstudios wants to merge 1 commit intomasterfrom
refactor/consolidate-riteway

Conversation

@2witstudios
Copy link
Copy Markdown
Owner

@2witstudios 2witstudios commented Mar 15, 2026

Summary

  • Consolidate 7 identical copies of the riteway.ts assert helper into one canonical location at apps/web/src/test/riteway.ts
  • Update all 16 test file imports to use @/test/riteway
  • Fix vitest.workspace.ts to reference apps/web/vitest.config.ts directly so path aliases resolve from the root test runner

Net change: -59 lines (7 files deleted, 16 one-line import updates)

Test plan

  • 4218 tests pass (252/254 files — 2 pre-existing DB integration failures unrelated to this change)
  • Root-level pnpm vitest run now resolves @/ aliases correctly for web tests
  • |web| workspace label preserved in test output

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Reorganized internal test infrastructure to centralize test utilities.
    • Updated test configuration for improved maintainability.

Move the shared test assert helper from 7 per-directory __tests__/
copies to a single apps/web/src/test/riteway.ts. Update all 16 test
file imports to use @/test/riteway.

Also update vitest.workspace.ts to reference apps/web/vitest.config.ts
directly so the @/ path alias resolves correctly from the root runner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7743da3c-2771-41fb-99eb-bb06b67cbd94

📥 Commits

Reviewing files that changed from the base of the PR and between 3e3a013 and bf4096e.

📒 Files selected for processing (23)
  • apps/web/src/app/api/memory/cron/__tests__/route.test.ts
  • apps/web/src/lib/ai/tools/__tests__/calendar-read-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/calendar-write-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/page-read-tools.test.ts
  • apps/web/src/lib/ai/tools/__tests__/search-tools.test.ts
  • apps/web/src/lib/editor/code-block/__tests__/code-block-shiki.test.ts
  • apps/web/src/lib/editor/code-block/__tests__/language-selector.test.tsx
  • apps/web/src/lib/editor/code-block/__tests__/riteway.ts
  • apps/web/src/lib/editor/code-block/__tests__/shiki-highlighter.test.ts
  • apps/web/src/lib/editor/code-block/__tests__/sudolang-grammar.test.ts
  • apps/web/src/lib/editor/code-block/__tests__/token-decorations.test.ts
  • apps/web/src/lib/integrations/google-calendar/__tests__/map-attendees.test.ts
  • apps/web/src/lib/integrations/google-calendar/__tests__/riteway.ts
  • apps/web/src/lib/integrations/google-calendar/__tests__/sync-service.test.ts
  • apps/web/src/lib/memory/__tests__/compaction-service.test.ts
  • apps/web/src/lib/memory/__tests__/discovery-service.test.ts
  • apps/web/src/lib/memory/__tests__/integration-service.test.ts
  • apps/web/src/lib/memory/__tests__/riteway.ts
  • apps/web/src/lib/utils/__tests__/riteway.ts
  • apps/web/src/lib/utils/__tests__/timestamp.test.ts
  • apps/web/src/test/riteway.ts
  • apps/web/vitest.config.ts
  • vitest.workspace.ts
💤 Files with no reviewable changes (4)
  • apps/web/src/lib/integrations/google-calendar/tests/riteway.ts
  • apps/web/src/lib/editor/code-block/tests/riteway.ts
  • apps/web/src/lib/memory/tests/riteway.ts
  • apps/web/src/lib/utils/tests/riteway.ts

📝 Walkthrough

Walkthrough

This PR consolidates scattered test assertion helpers across multiple directories by centralizing them into a single @/test/riteway alias path. Multiple test files are updated to import from this centralized location, and local riteway.ts implementations are deleted. Vitest configuration is also adjusted to reference an external config file.

Changes

Cohort / File(s) Summary
Test Helper Centralization
apps/web/src/app/api/memory/cron/__tests__/route.test.ts, apps/web/src/lib/ai/tools/__tests__/calendar-read-tools.test.ts, apps/web/src/lib/ai/tools/__tests__/calendar-write-tools.test.ts, apps/web/src/lib/ai/tools/__tests__/page-read-tools.test.ts, apps/web/src/lib/ai/tools/__tests__/search-tools.test.ts, apps/web/src/lib/editor/code-block/__tests__/code-block-shiki.test.ts, apps/web/src/lib/editor/code-block/__tests__/language-selector.test.tsx, apps/web/src/lib/editor/code-block/__tests__/shiki-highlighter.test.ts, apps/web/src/lib/editor/code-block/__tests__/sudolang-grammar.test.ts, apps/web/src/lib/editor/code-block/__tests__/token-decorations.test.ts, apps/web/src/lib/integrations/google-calendar/__tests__/map-attendees.test.ts, apps/web/src/lib/integrations/google-calendar/__tests__/sync-service.test.ts, apps/web/src/lib/memory/__tests__/compaction-service.test.ts, apps/web/src/lib/memory/__tests__/discovery-service.test.ts, apps/web/src/lib/memory/__tests__/integration-service.test.ts, apps/web/src/lib/utils/__tests__/timestamp.test.ts
Updated test imports from local relative paths (./riteway) to centralized alias path (@/test/riteway), with no changes to test logic or behavior.
Riteway Helper Deletion
apps/web/src/lib/editor/code-block/__tests__/riteway.ts, apps/web/src/lib/integrations/google-calendar/__tests__/riteway.ts, apps/web/src/lib/memory/__tests__/riteway.ts, apps/web/src/lib/utils/__tests__/riteway.ts
Removed local test assertion helper files containing the AssertParams interface and assert() function, consolidating them into a shared centralized location.
Vitest Configuration
apps/web/vitest.config.ts, vitest.workspace.ts
Added test suite name identifier to web config; refactored workspace configuration to reference external web vitest config file instead of inline configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • PR #78: Modifies test infrastructure and centralizes Vitest configuration, aligning with the consolidation of test utilities in this PR.
  • PR #77: Updates Vitest test configuration and test scaffolding alongside similar test helper reorganization efforts.
  • PR #74: Modifies the web Vitest configuration file that is also being restructured in this change.

Poem

🐰 Test helpers scattered far and wide,
Now gathered in one central tide,
From riteway's many homes they flee,
To @/test/riteway—unified spree!
Hopping faster with each import so true.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: consolidate riteway test helpers' accurately describes the main change: consolidating multiple duplicate test helper files into a single canonical one and updating imports.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/consolidate-riteway
📝 Coding Plan
  • Generate coding plan for human review comments

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