这是indexloc提供的服务,不要输入任何密码
Skip to content

test(turbo-trace): increase import_finder.rs coverage #10649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Jul 8, 2025

Summary

This PR significantly increases code coverage for by adding targeted unit tests that exercise previously uncovered branches and logic.

Improvements

  • Adds tests for:
    • Type-only imports
    • Value-only imports
    • Export named and export all declarations
    • CommonJS detection
  • Ensures all ImportTraceType branches and import/export variants are covered
  • Fixes test harness to use correct SWC source file handling

Coverage Impact

  • Before: 64.00%
  • After: 88.89%
  • Delta: +24.89 percentage points

All new tests pass. No production code changes.

Testing instructions

CI

@anthonyshew anthonyshew requested a review from a team as a code owner July 8, 2025 15:17
Copy link

vercel bot commented Jul 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-tailwind-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
examples-vite-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:03pm

- Add telemetry endpoint to mock server for testing
- Add 3 comprehensive tests for record_telemetry functionality:
  * test_record_telemetry_success: Tests successful telemetry recording with multiple events
  * test_record_telemetry_empty_events: Tests telemetry recording with empty event list
  * test_record_telemetry_with_different_event_types: Tests telemetry recording with different event types

Coverage improvements:
- telemetry.rs: 14.29% → 71.43% (+57.14 percentage points)
- api-client crate overall: 50.61% → 56.51% (+5.9 percentage points)

Tests cover HTTP request construction, header setting, and error handling through retry mechanism.
@anthonyshew anthonyshew changed the title test(turbo-trace): increase import_finder.rs coverage with targeted tests test(turbo-trace): increase import_finder.rs coverage Jul 22, 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.

1 participant