Skip to content

refactor: strengthen type safety #1015

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

Merged
merged 4 commits into from
Jun 4, 2025
Merged

Conversation

y-hsgw
Copy link
Contributor

@y-hsgw y-hsgw commented May 31, 2025

It's a minor change, but I refactored a few parts that caught my attention. Please feel free to close this PR if it doesn't meet your expectations. I appreciate your review!

Checks

Changes

  • update test case types to use rule-tester types.
    → Due to deprecation of TSESLint's InvalidTestCase and ValidTestCase.

  • apply as const for stricter type safety on query definitions.

  • add explicit return type to createTestingLibraryRule for better type safety.
    → Because a type error occurred in test files when passing the rule as the second argument to ruleTester.run.

Context

Copy link

codecov bot commented May 31, 2025

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.28%. Comparing base (26d360e) to head (a90211d).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
lib/create-testing-library-rule/index.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1015   +/-   ##
=======================================
  Coverage   96.27%   96.28%           
=======================================
  Files          46       47    +1     
  Lines        2472     2531   +59     
  Branches     1025     1047   +22     
=======================================
+ Hits         2380     2437   +57     
- Misses         92       94    +2     

☔ 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.

@Belco90 Belco90 self-requested a review June 2, 2025 05:28
@Belco90 Belco90 added the chore Changes that affect the build system, CI config or other changes that don't modify src/test files label Jun 2, 2025
Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this! Just added some comments.

@y-hsgw y-hsgw requested a review from Belco90 June 2, 2025 12:31
@Belco90 Belco90 changed the title refactor: Strengthen Type Safety and Fix Test File Compilation Errors refactor: strengthen type safety Jun 4, 2025
@Belco90 Belco90 merged commit 5b24014 into testing-library:main Jun 4, 2025
31 checks passed
@y-hsgw y-hsgw deleted the pr/refactor branch June 4, 2025 05:33
Copy link

github-actions bot commented Jun 5, 2025

🎉 This PR is included in version 7.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that affect the build system, CI config or other changes that don't modify src/test files released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants