On this page
Overview
SnapshotTesting is a Swift snapshot-testing library. Beyond images of views and view controllers, it can record recursive descriptions, URL requests, JSON, property lists, dumps, and other representations, then compare later test runs against those references.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Compare image, text, and data representations with assertSnapshot
The first run records a reference snapshot to disk and later runs compare runtime values against it. Strategies include images, recursive descriptions, raw requests, JSON, property lists, dumps, and more.
Sources: [2]
Control recording and UI conditions with record policies and device traits
Recording can be enabled per assertion or scope, and UI snapshots can target specific devices and trait collections. The library integrates with both Swift Testing and XCTest.
Sources: [2]
Best fit
Fits test suites that want reviewable diffs for UI, API requests, and serialized output
It is useful for visual regressions as well as structural changes in URL requests, Encodable output, and other values that benefit from checked-in references.
Sources: [2]
Before adoption
Image snapshots require consistent simulator conditions, and 1.19.6 fixes a macOS 27 comparison crash
The README warns that image snapshots should be compared on the same simulator used to create the reference. Package.swift uses Swift tools 6.0 and requires iOS 13+, while 1.19.6 fixes a perceptual image comparison crash on macOS 27.
Official sources
- [1]pointfreeco/swift-snapshot-testing — GitHub repository(2026-10-06)
- [2]SnapshotTesting 1.19.6 — README(2026-10-06)
- [3]SnapshotTesting 1.19.6 — Package.swift(2026-10-06)
- [4]SnapshotTesting 1.19.6 release(2026-10-06)
- [5]SnapshotTesting MIT license(2026-10-06)
Supplemental curator note
SnapshotTesting fits iOS test suites that want reviewable reference diffs for UI, requests, and serialized output. Keep simulator conditions consistent for image snapshots.
Try it in 3 steps
- 1
Add SnapshotTesting 1.19.6 to the test target
Link SnapshotTesting only from a test target. The package requires iOS 13+.
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", exact: "1.19.6") - 2
Record a value as a dump snapshot
The first run records the reference and later runs compare the same representation.
import SnapshotTesting assertSnapshot(of: ["red", "green", "blue"], as: .dump) - 3
Explicitly re-record an intentional change
Enable recording only for intentional changes and review the updated snapshot in source control.
assertSnapshot(of: ["red", "green", "blue"], as: .dump, record: .all)
Growth
Growth trends · Last 30 days
4,362 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 2
- Open PRs
- 83
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- swift
- testing
- snapshot-testing
- screenshot-testing
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Turbine2,863 Stars
2 shared tag(s) · 2 shared category(s)
assert kotlinx.coroutines Flow items, completion, and errors in event order
Kotlin - Argos636 Stars
2 shared tag(s) · 2 shared category(s)
review UI changes by comparing visual diffs for each pull request
TypeScript - The Composable Architecture14,952 Stars
3 shared tag(s) · 2 shared category(s) · Same language
build composable SwiftUI and UIKit features around State, Action, Reducer, and Store
Swift - Quick9,825 Stars
3 shared tag(s) · 2 shared category(s) · Same language
organize Swift and Objective-C tests as BDD specifications with describe, context, and it
Swift - Nimble4,836 Stars
3 shared tag(s) · 2 shared category(s) · Same language
express Swift test expectations with expect, matchers, and polling assertions
Swift - Jest45,500 Stars
3 shared tag(s) · 2 shared category(s)
Combine assertions, mocks, watch mode, snapshots, coverage, and worker isolation in one JavaScript test runner
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.