Skip to content

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Oct 1, 2025

Summary

Adds comprehensive test coverage for all 5 call sites of check_restrictions in src/lib.rs:

  • load_index() with enforce_extension disabled (line 783)
  • load_alias_or_file() direct file check (line 831)
  • ✅ Browser field/alias recursive resolution (line 1148)
  • load_extension_alias() after file exists (line 1326)
  • ✅ Package main field resolution (line 1570)

Also adds tests for:

  • Multiple restrictions working together
  • All restrictions must pass logic
  • is_inside() helper edge cases

Test Results

All 14 tests pass (5 original + 9 new):

test result: ok. 14 passed; 0 failed

Closes #613

🤖 Generated with Claude Code

Copy link

graphite-app bot commented Oct 1, 2025

How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.77%. Comparing base (318a498) to head (28c4e04).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #739      +/-   ##
==========================================
+ Coverage   94.58%   94.77%   +0.18%     
==========================================
  Files          15       15              
  Lines        2920     2908      -12     
==========================================
- Hits         2762     2756       -6     
+ Misses        158      152       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

codspeed-hq bot commented Oct 1, 2025

CodSpeed Performance Report

Merging #739 will not alter performance

Comparing improve-check-restrictions-coverage (28c4e04) with main (fba8319)

Summary

✅ 7 untouched
⏩ 2 skipped1

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Add comprehensive test coverage for all 5 call sites of check_restrictions:
- load_index() with enforce_extension disabled (line 783)
- load_alias_or_file() direct file check (line 831)
- browser field/alias recursive resolution (line 1148)
- load_extension_alias() after file exists (line 1326)
- package main field resolution (line 1570)

Also add tests for:
- Multiple restrictions working together
- All restrictions must pass logic
- is_inside() helper edge cases

Closes #613

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Boshen Boshen force-pushed the improve-check-restrictions-coverage branch from f2e72ad to 28c4e04 Compare October 1, 2025 13:09
@Boshen Boshen merged commit 4ac2c32 into main Oct 1, 2025
15 of 16 checks passed
@Boshen Boshen deleted the improve-check-restrictions-coverage branch October 1, 2025 13:15
@Boshen Boshen mentioned this pull request Oct 1, 2025
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.

improve test coverage of new check_restrictions
1 participant