Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis committed Jan 25, 2025
1 parent 8b7e942 commit b1bc5c1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let package = Package(
.testTarget(
name: "SnapshotTestingTests",
dependencies: [
"SnapshotTesting"
"SnapshotTesting",
],
exclude: [
"__Fixtures__",
Expand All @@ -46,6 +46,7 @@ let package = Package(
name: "InlineSnapshotTesting",
dependencies: [
"SnapshotTesting",
"SnapshotTestingCustomDump",
.product(name: "SwiftParser", package: "swift-syntax"),
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
Expand Down
26 changes: 26 additions & 0 deletions Tests/InlineSnapshotTestingTests/CustomDumpTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#if canImport(Testing)
import Testing
import InlineSnapshotTesting
import SnapshotTestingCustomDump

@Suite(
.snapshots(
record: .missing
)
)
struct CustomDumpSnapshotTests {
@Test func basics() {
struct User { let id: Int, name: String, bio: String }
let user = User(id: 1, name: "Blobby", bio: "Blobbed around the world.")
assertInlineSnapshot(of: user, as: .customDump) {
"""
CustomDumpSnapshotTests.User(
id: 1,
name: "Blobby",
bio: "Blobbed around the world."
)
"""
}
}
}
#endif

0 comments on commit b1bc5c1

Please sign in to comment.