OSS TanbouSign in with GitHub

detect regressions by comparing UI, requests, JSON, and other values against reference snapshots

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
4,362
Primary language
Swift
License
MIT
Repository last updated
Sep 21, 2026
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.

Sources: [2][3][4]

Official sources

  1. [1]pointfreeco/swift-snapshot-testing — GitHub repository(2026-10-06)
  2. [2]SnapshotTesting 1.19.6 — README(2026-10-06)
  3. [3]SnapshotTesting 1.19.6 — Package.swift(2026-10-06)
  4. [4]SnapshotTesting 1.19.6 release(2026-10-06)
  5. [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. 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. 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. 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)
Check the official README

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

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • swift
  • testing
  • snapshot-testing
  • screenshot-testing
Stars
4,362
Forks
685
Watchers
34
Open issues
140
Contributors
100
Owner type
Organization
Primary language
Swift
License
MIT
Repository last updated
Sep 21, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?