Skip to content

Commit 104d43f

Browse files
committed
wip
1 parent 9a6f879 commit 104d43f

9 files changed

+23
-17
lines changed

Sources/SnapshotTesting/AssertSnapshot.swift

-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import XCTest
22

33
/// Enhances failure messages with a command line diff tool expression that can be copied and pasted
44
/// into a terminal.
5-
///
6-
/// This API has been deprecated in favor of
7-
/// ``withSnapshotTesting(diffTool:record:operation:)-7xmhk``.
85
@available(*, deprecated, message: "Use 'withSnapshotTesting' to customize the diff tool. See the documentation for more information.")
96
public var diffTool: SnapshotTestingConfiguration.DiffTool {
107
get { _diffTool }
@@ -15,9 +12,6 @@ public var diffTool: SnapshotTestingConfiguration.DiffTool {
1512
public var _diffTool: SnapshotTestingConfiguration.DiffTool = .default
1613

1714
/// Whether or not to record all new references.
18-
///
19-
/// This API has been deprecated in favor of
20-
/// ``withSnapshotTesting(diffTool:record:operation:)-7xmhk``.
2115
@available(*, deprecated, message: "Use 'withSnapshotTesting' to customize the record mode. See the documentation for more information.")
2216
public var isRecording: Bool {
2317
get { SnapshotTestingConfiguration.current?.record ?? _record == .all }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# ``SnapshotTesting/diffTool``
2+
3+
@DeprecationSummary {
4+
Use ``withSnapshotTesting(record:diffTool:operation:)-59u9g`` to customize the diff tool, instead.
5+
See <doc:MigratingTo1.17> for more information.
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# ``SnapshotTesting/isRecording``
2+
3+
@DeprecationSummary {
4+
Use ``withSnapshotTesting(record:diffTool:operation:)-59u9g`` to customize the record mode,
5+
instead. See <doc:MigratingTo1.17> for more information.
6+
}

Sources/SnapshotTesting/Documentation.docc/MigrationGuides/MigratingTo1.17.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ diffs of files, but only works when the command line tool accepts a very narrow
3737
_e.g._ `ksdiff /path/to/file1.png /path/to/file2.png`.
3838

3939
We have greatly improved upon all of these problems by introducing the new
40-
``withSnapshotTesting(diffTool:record:operation:)-7xmhk`` tool for customizing snapshots. It
40+
``withSnapshotTesting(record:diffTool:operation:)-59u9g`` tool for customizing snapshots. It
4141
allows you to customize how the `assertSnapshot` tool behaves for a well-defined scope.
4242

4343
Rather than overriding `isRecording` or `diffTool` directly in your tests, you can wrap your test in

Sources/SnapshotTesting/Documentation.docc/SnapshotTesting.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Powerfully flexible snapshot testing.
1818

1919
### Configuration
2020

21-
- ``withSnapshotTesting(diffTool:record:operation:)-7xmhk``
21+
- ``withSnapshotTesting(record:diffTool:operation:)-59u9g``
2222
- ``SnapshotTestingConfiguration``
2323

2424
### Deprecations
2525

26-
- <doc:Deprecations>
26+
- <doc:SnapshotTestingDeprecations>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# ``SnapshotTesting/withSnapshotTesting(diffTool:record:operation:)-7xmhk``
1+
# ``SnapshotTesting/withSnapshotTesting(record:diffTool:operation:)-59u9g``
22

33
## Topics
44

55
### Overloads
66

7-
- ``withSnapshotTesting(diffTool:record:operation:)-4s6ad``
7+
- ``withSnapshotTesting(record:diffTool:operation:)-b1i4``

Sources/SnapshotTesting/SnapshotTestingConfiguration.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
/// ```
2121
///
2222
/// - Parameters:
23-
/// - diffTool: The diff tool to use while asserting snapshots.
2423
/// - record: The record mode to use while asserting snapshots.
24+
/// - diffTool: The diff tool to use while asserting snapshots.
2525
/// - operation: The operation to perform.
2626
public func withSnapshotTesting<R>(
27-
diffTool: SnapshotTestingConfiguration.DiffTool? = nil,
2827
record: SnapshotTestingConfiguration.Record? = nil,
28+
diffTool: SnapshotTestingConfiguration.DiffTool? = nil,
2929
operation: () throws -> R
3030
) rethrows -> R {
3131
try SnapshotTestingConfiguration.$current.withValue(
@@ -40,10 +40,10 @@ public func withSnapshotTesting<R>(
4040

4141
/// Customizes `assertSnapshot` for the duration of an asynchronous operation.
4242
///
43-
/// See ``withSnapshotTesting(diffTool:record:operation:)-7xmhk`` for more information.
43+
/// See ``withSnapshotTesting(record:diffTool:operation:)-59u9g`` for more information.
4444
public func withSnapshotTesting<R>(
45-
diffTool: SnapshotTestingConfiguration.DiffTool? = nil,
4645
record: SnapshotTestingConfiguration.Record? = nil,
46+
diffTool: SnapshotTestingConfiguration.DiffTool? = nil,
4747
operation: () async throws -> R
4848
) async rethrows -> R {
4949
try await SnapshotTestingConfiguration.$current.withValue(

Sources/SnapshotTesting/SnapshotsTestTrait.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
testCase: Test.Case?
3434
) async throws {
3535
try await withSnapshotTesting(
36-
diffTool: configuration.diffTool,
37-
record: configuration.record
36+
record: configuration.record,
37+
diffTool: configuration.diffTool
3838
) {
3939
try await function()
4040
}

0 commit comments

Comments
 (0)