Skip to content

Commit

Permalink
Fixes file naming during snapshot creation applying the name and line…
Browse files Browse the repository at this point in the history
… of the caller (#60)
  • Loading branch information
LukasLiebl authored Jul 24, 2023
1 parent 04a6c81 commit 8488c1c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Sources/SnapshotTestingExtensions/SnapshotTestBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ open class SnapshotTestBase: XCTestCase {
view,
as: .image(on: config.device, precision: imageDiffPrecision),
style: style,
config: config
config: config,
file: file,
testName: testName,
line: line
)
}
}
Expand All @@ -57,7 +60,10 @@ open class SnapshotTestBase: XCTestCase {
view,
as: .wait(for: wait, on: .image(on: config.device, precision: imageDiffPrecision)),
style: style,
config: config
config: config,
file: file,
testName: testName,
line: line
)
}
}
Expand All @@ -67,9 +73,9 @@ open class SnapshotTestBase: XCTestCase {
as snapshotting: Snapshotting<UIViewController, UIImage>,
style: [UIUserInterfaceStyle] = [.unspecified],
config: (name: String, device: ViewImageConfig),
file: StaticString = #file,
testName: String = #function,
line: UInt = #line
file: StaticString,
testName: String,
line: UInt
) {
style.forEach { uiStyle in
let vc = UIHostingController(rootView: view)
Expand Down

0 comments on commit 8488c1c

Please sign in to comment.