test: fn() wrapper and skillSource trust classification#367
Conversation
Add 12 new tests for two previously untested modules: - fn() zod-validated function wrapper (5 tests) — used in 10+ core modules - skillSource() trust classification (7 tests) — determines skill provenance labels Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> https://claude.ai/code/session_01A73k9MRUmXYHgUNzd9oJKk
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
What does this PR do?
Adds 12 new tests across two previously untested modules discovered during automated test-discovery reconnaissance.
1.
fn()zod-validated function wrapper —src/util/fn.ts(5 new tests)This utility wraps functions with zod schema validation and is imported in 10+ core modules including session management, permission evaluation, compaction, and project creation. Zero tests existed despite being a critical path dependency. New coverage includes:
.force()bypasses validation (used for internal trusted calls).schemaexposes the original zod schema for introspection2.
skillSource()trust classification —src/cli/cmd/skill-helpers.ts(7 new tests)This function determines whether a skill is classified as "builtin", "global", or "project" — a trust boundary that affects how skills are displayed and whether they receive elevated trust in the CLI. Zero tests existed. New coverage includes:
builtin:prefix correctly returns "builtin"~/.altimate/builtin/path correctly returns "builtin"~/.claude/skills/,~/.agents/skills/,~/.altimate-code/skills/all correctly return "global"Tests use
process.env.OPENCODE_TEST_HOME || os.homedir()to match theGlobal.Path.homegetter behavior, ensuring deterministic results in both local and CI environments.Type of change
Issue for this PR
N/A — proactive test coverage from automated test-discovery
How did you verify your code works?
Checklist
https://claude.ai/code/session_01A73k9MRUmXYHgUNzd9oJKk