You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/AssertSnapshot.swift
+5-3
Original file line number
Diff line number
Diff line change
@@ -155,6 +155,7 @@ public func assertSnapshots<Value, Format>(
155
155
/// - name: An optional description of the snapshot.
156
156
/// - recording: Whether or not to record a new reference.
157
157
/// - snapshotDirectory: Optional directory to save snapshots. By default snapshots will be saved in a directory with the same name as the test file, and that directory will sit inside a directory `__Snapshots__` that sits next to your test file.
158
+
/// - snapshotSubdirectory: The default subdirectory for snapshots in the same directory as the test file. Defaults to `__Snapshots__` that sits next to your test file. Only used when `snapshotDirectory` is nil.
158
159
/// - timeout: The amount of time a snapshot must be generated in.
159
160
/// - file: The file in which failure occurred. Defaults to the file name of the test case in which this function was called.
160
161
/// - testName: The name of the test in which failure occurred. Defaults to the function name of the test case in which this function was called.
@@ -165,8 +166,9 @@ public func verifySnapshot<Value, Format>(
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/CALayer.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ extension Snapshotting where Value == CALayer, Format == NSImage {
12
12
/// - Parameters:
13
13
/// - precision: The percentage of pixels that must match.
14
14
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
returnSimplySnapshotting.image(precision: precision, perceptualPrecision: perceptualPrecision).pullback{ layer in
17
17
letimage=NSImage(size: layer.bounds.size)
18
18
image.lockFocus()
@@ -40,7 +40,7 @@ extension Snapshotting where Value == CALayer, Format == UIImage {
40
40
/// - precision: The percentage of pixels that must match.
41
41
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/CGPath.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ extension Snapshotting where Value == CGPath, Format == NSImage {
12
12
/// - Parameters:
13
13
/// - precision: The percentage of pixels that must match.
14
14
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
@@ -43,7 +43,7 @@ extension Snapshotting where Value == CGPath, Format == UIImage {
43
43
/// - Parameters:
44
44
/// - precision: The percentage of pixels that must match.
45
45
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ extension Snapshotting where Value == NSBezierPath, Format == NSImage {
12
12
/// - Parameters:
13
13
/// - precision: The percentage of pixels that must match.
14
14
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/NSImage.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ extension Diffing where Value == NSImage {
12
12
/// - precision: The percentage of pixels that must match.
13
13
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
@@ -44,7 +44,7 @@ extension Snapshotting where Value == NSImage, Format == NSImage {
44
44
/// - Parameters:
45
45
/// - precision: The percentage of pixels that must match.
46
46
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/NSView.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ extension Snapshotting where Value == NSView, Format == NSImage {
13
13
/// - precision: The percentage of pixels that must match.
14
14
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/NSViewController.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ extension Snapshotting where Value == NSViewController, Format == NSImage {
13
13
/// - precision: The percentage of pixels that must match.
14
14
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/SceneKit.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ extension Snapshotting where Value == SCNScene, Format == NSImage {
14
14
/// - precision: The percentage of pixels that must match.
15
15
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
@@ -26,7 +26,7 @@ extension Snapshotting where Value == SCNScene, Format == UIImage {
26
26
/// - precision: The percentage of pixels that must match.
27
27
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
/// The default subdirectory for snapshots in the same directory as the test file. Defaults to `__Snapshots__` that sits next to your test file. Only used when `snapshotDirectory` is nil.
/// Optional directory to save snapshots. By default snapshots will be saved in a directory with the same name as the test file, and that directory will sit inside a directory `__Snapshots__` that sits next to your test file.
8
+
publicstaticvarsnapshotDirectory:String?=nil
9
+
/// The amount of time a snapshot must be generated in.
10
+
publicstaticvartimeout:TimeInterval=5
11
+
/// The percentage of pixels that must match. Value between 0-1
12
+
publicstaticvarprecision:Float=1
13
+
14
+
/// The byte-value threshold at which two subpixels are considered different. Value between 0-255
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/SpriteKit.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ extension Snapshotting where Value == SKScene, Format == NSImage {
14
14
/// - precision: The percentage of pixels that must match.
15
15
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
@@ -26,7 +26,7 @@ extension Snapshotting where Value == SKScene, Format == UIImage {
26
26
/// - precision: The percentage of pixels that must match.
27
27
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/UIBezierPath.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ extension Snapshotting where Value == UIBezierPath, Format == UIImage {
13
13
/// - precision: The percentage of pixels that must match.
14
14
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
15
15
/// - scale: The scale to use when loading the reference image from disk.
Copy file name to clipboardExpand all lines: Sources/SnapshotTesting/Snapshotting/UIImage.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ extension Diffing where Value == UIImage {
13
13
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
14
14
/// - scale: Scale to use when loading the reference image from disk. If `nil` or the `UITraitCollection`s default value of `0.0`, the screens scale is used.
@@ -65,7 +65,7 @@ extension Snapshotting where Value == UIImage, Format == UIImage {
65
65
/// - precision: The percentage of pixels that must match.
66
66
/// - perceptualPrecision: The percentage a pixel must match the source pixel to be considered a match. [98-99% mimics the precision of the human eye.](http://zschuessler.github.io/DeltaE/learn/#toc-defining-delta-e)
67
67
/// - scale: The scale of the reference image stored on disk.
0 commit comments