Skip to content

Conversation

@grynspan
Copy link
Contributor

@grynspan grynspan commented Nov 11, 2025

This PR adds prose documentation explaining how to create attachments and add them to tests.

Resolves #1143.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

This PR adds prose documentation explaining how to create attachments and add
them to tests.

Resolves #1143.
@grynspan grynspan added this to the Swift 6.3.0 milestone Nov 11, 2025
@grynspan grynspan self-assigned this Nov 11, 2025
@grynspan grynspan added documentation 📚 Improvements or additions to documentation enhancement New feature or request attachments/activities 🖇️ Work related to attachments and/or activities image-attachments 📸 Work related to image attachments labels Nov 11, 2025
///
/// - ``Trait/savingAttachments(if:)``
///
/// By default, the testing library saves your attachments as soon as you call
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is all SPI.

@grynspan
Copy link
Contributor Author

Tracked internally as rdar://164478451.

Copy link
Contributor

@jerryjrchen jerryjrchen left a comment

Choose a reason for hiding this comment

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

Looks great!

Comment on lines +184 to +186
- When using Swift Package Manager's `swift test` command, you can pass the
`--attachments-path` option. The testing library saves attachments to the
specified directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we clarify that if this CLI flag is not passed, attachments will not be saved anywhere? I wonder if that's even worth an "Important" callout or similar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to leave it as-is and let our DevPubs colleagues consider how to phrase it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attachments/activities 🖇️ Work related to attachments and/or activities documentation 📚 Improvements or additions to documentation enhancement New feature or request image-attachments 📸 Work related to image attachments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write prose documentation for attachments

4 participants