Skip to content
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

Add swiftTestingTestCaseNames rule #1979

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

calda
Copy link
Collaborator

@calda calda commented Feb 19, 2025

This PR adds a new swiftTestingTestCaseNames rule to remove any "test" prefix from Swift Testing test cases. Unlike in XCTest, Swift Testing test cases don't need to be prefixed with "test".

  import Testing

  struct MyFeatureTests {
-     @Test func testMyFeatureHasNoBugs() {
+     @Test func myFeatureHasNoBugs() {
          let myFeature = MyFeature()
          myFeature.runAction()
          #expect(!myFeature.hasBugs, "My feature has no bugs")
          #expect(myFeature.crashes.isEmpty, "My feature doesn't crash")
          #expect(myFeature.crashReport == nil)
      }
  }

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.55%. Comparing base (bf5e04e) to head (553e6c2).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1979      +/-   ##
===========================================
+ Coverage    95.53%   95.55%   +0.01%     
===========================================
  Files          139      140       +1     
  Lines        25620    25671      +51     
===========================================
+ Hits         24477    24530      +53     
+ Misses        1143     1141       -2     

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

@calda calda merged commit 9c04587 into nicklockwood:develop Feb 24, 2025
11 checks passed
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