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
14
14
15
15
``` swift
16
16
import SnapshotTesting
17
- import XCTest
17
+ import Testing
18
18
19
- class MyViewControllerTests : XCTestCase {
20
- func testMyViewController () {
19
+ @MainActor
20
+ struct MyViewControllerTests {
21
+ @Test func myViewController () {
21
22
let vc = MyViewController ()
22
23
23
24
assertSnapshot (of : vc, as : .image )
@@ -52,10 +53,14 @@ withSnapshotTesting(record: .all) {
52
53
assertSnapshot (of : vc3, as : .image )
53
54
}
54
55
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:
56
61
class FeatureTests : XCTestCase {
57
62
override func invokeTest () {
58
- withSnapshotTesting (record : .all ) {
63
+ withSnapshotTesting (record : .failed ) {
59
64
super .invokeTest ()
60
65
}
61
66
}
You can’t perform that action at this time.
0 commit comments