File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,11 @@ Once [installed](#installation), _no additional configuration is required_. You
1414
1515``` swift
1616import SnapshotTesting
17- import XCTest
17+ import Testing
1818
19- class MyViewControllerTests : XCTestCase {
20- func testMyViewController () {
19+ @MainActor
20+ struct MyViewControllerTests {
21+ @Test func myViewController () {
2122 let vc = MyViewController ()
2223
2324 assertSnapshot (of : vc, as : .image )
@@ -52,10 +53,14 @@ withSnapshotTesting(record: .all) {
5253 assertSnapshot (of : vc3, as : .image )
5354}
5455
55- // Record all snapshots in an XCTestCase subclass:
56+ // Record all snapshot failures in a Swift Testing suite:
57+ @Suite (.snapshots (record : .failed ))
58+ struct FeatureTests {}
59+
60+ // Record all snapshot failures in an 'XCTestCase' subclass:
5661class FeatureTests : XCTestCase {
5762 override func invokeTest () {
58- withSnapshotTesting (record : .all ) {
63+ withSnapshotTesting (record : .failed ) {
5964 super .invokeTest ()
6065 }
6166 }
You can’t perform that action at this time.
0 commit comments