@@ -151,16 +151,12 @@ in an XCTest context or a Swift Testing context, and will determine if it should
151
151
` Issue.record` to trigger a test failure.
152
152
153
153
For the most part you can write tests for Swift Testing exactly as you would for XCTest. However,
154
- there is one major difference. Swift Testing does not (yet) have a substitute for ` invokeTest` ,
155
- which we used alongside ` withSnapshotTesting` to customize snapshotting for a full test class.
156
-
157
- There is an experimental version of this tool in Swift Testing, called ` CustomExecutionTrait` , and
158
- this library provides such a trait called ` ` Testing/Trait/snapshots(diffTool:record:)` ` . It allows
159
- you to customize snapshots for a ` @Test` or ` @Suite` , but to get access to it you must perform an
160
- ` @_spi(Experimental)` import of snapshot testing:
154
+ there is one major difference. In order to override a snapshot' s
155
+ [configuration](<doc:SnapshotTestingConfiguration>) for a particular test or an entire suite you
156
+ must use what are known as "test traits":
161
157
162
158
```swift
163
- @_spi(Experimental) import SnapshotTesting
159
+ import SnapshotTesting
164
160
165
161
@Suite(.snapshots(record: .all, diffTool: .ksdiff))
166
162
struct FeatureTests {
@@ -169,7 +165,4 @@ struct FeatureTests {
169
165
```
170
166
171
167
That will override the `diffTool` and `record` options for the entire `FeatureTests` suite.
172
-
173
- > Important: As evident by the usage of ` @_spi(Experimental)` this API is subject to change. As
174
- soon as the Swift Testing library finalizes its API for ` CustomExecutionTrait` we will update
175
- the library accordingly and remove the ` @_spi` annotation.
168
+ These traits can also be used on individual `@Test`s too.
0 commit comments