-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Link Swift Testing documentation in its test template #9368
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
base: main
Are you sure you want to change the base?
Conversation
This hopefully makes it easier for new users to find relevant documentation for our test framework! It also matches the existing pattern where XCTest documentation is linked in its respective test template.
|
Is there an equivalent link on swift.org we could use? |
Closest I could find is https://www.swift.org/documentation/core-libraries/#swift-testing, which transitively links to the Swift Testing GitHub repo. |
| @Test func example() async throws { | ||
| // Write your test here and use APIs like `#expect(...)` to check expected conditions. | ||
| // Swift Testing Documentation | ||
| // https://developer.apple.com/documentation/testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (blocking): I love this and completely support it. Though,I have been disappointed (for a lack of a better word) previously while inspecting the Apple XCTest documentation when targeting non-Apple devices as the XCTest API is not identical on macOS and Linux. Although I suspect this is not the case with Swift Testing, my experience has lead me to not have confidence that the developer.apple.com documentation will be valid on non-apple platforms.
Can the link point to the Swift.org Swift Testing API. If that documentation is not published, I would say updating the template is gating upon that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though,I have been disappointed (for a lack of a better word) previously while inspecting the Apple XCTest documentation when targeting non-Apple devices as the XCTest API is not identical on macOS and Linux.
Feel free to open a PR, although I have no idea where you'd do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the link point to the Swift.org Swift Testing API. If that documentation is not published, I would say updating the template is gating upon that.
Could we link to swiftpackageindex.com? There's a copy of the documentation hosted there.
Link Swift Testing documentation in its test template
Motivation:
This hopefully makes it easier for new users to find relevant documentation for our test framework!
It also matches the existing pattern where XCTest documentation is linked in its respective test template.
Modifications:
trim_trailing_whitespace = truedirective. I can manually put them back if that would be better.Result:
Default Swift Testing template will include a comment linking to the developer docs.
Testing it locally: