Skip to content

2.0.0

Choose a tag to compare

@choule99 choule99 released this 18 Jul 23:26
Immutable release. Only release title and notes can be modified.
2.0.0
67055ea

2.0.0

Major Swift 6 modernization release with typed configuration APIs, expanded platform and device support, more deterministic rendering, and an in-tree CustomDump implementation.

Breaking and migration changes

  • Requires Swift tools 6.3 and Swift 6 language mode.
  • Raises minimum deployments to iOS 17, macOS 13, tvOS 17, and watchOS 10.
  • Removes the legacy Package@swift-5.9.swift manifest.
  • Assertion, strategy, and diffing APIs now use @MainActor, Sendable, and @Sendable. Custom strategies and non-main-actor calls may require isolation changes.
  • Scalar assertion and image-precision overloads remain available but are deprecated in favor of typed options.
  • Rendering, color-space, sizing, and environment changes may alter existing image references. Review and re-record affected snapshots.
  • CustomDump is now vendored. Clients using this package's CustomDump product should remove separate upstream swift-custom-dump dependencies to avoid duplicate module or product conflicts.

Typed configuration

  • Adds SnapshotAssertionOptions for record mode, diff tool, reference directory, artifact directory, and timeout.
  • Adds InlineSnapshotAssertionOptions for record mode, timeout, and syntax descriptor.
  • Adds ImageSnapshotOptions for reusable pixel and perceptual precision.
  • Retains deprecated forwarding overloads for migration.
  • Adds per-assertion reference and artifact directories.
  • Adds per-assertion diff tool overrides.
  • Ignores blank artifact paths.
  • Adds process-wide, thread-safe accessedSnapshotPaths and resetAccessedSnapshotPaths() APIs.
  • Adds SnapshotTestingConfiguration.SnapshotNaming.testName for counterless unnamed snapshots, with collision detection.

SwiftUI configuration

  • Adds scoped locale, time zone, and calendar configuration through SnapshotTestingConfiguration, withSnapshotTesting, and Swift Testing traits.
  • Uses deterministic SwiftUI defaults: en_US_POSIX, UTC, and Gregorian calendar.
  • Applies requested traits before SwiftUI body evaluation and sizing.
  • Uses ideal fixed sizing for .sizeThatFits snapshots.

Platform and device support

  • Adds SwiftUI image snapshots on macOS 13+ using ImageRenderer at deterministic 2x scale.
  • Adds watchOS 10+ image snapshots for UIImage and SwiftUI values. Pixel precision is supported; perceptual precision is unavailable.
  • Supports concrete UIView, UIViewController, NSView, and NSViewController subclasses.
  • Adds iPhone 14 through 17 families, iPhone 16e, and iPhone Air configurations.
  • Adds current iPad mini, iPad, iPad Air, and iPad Pro configurations with split-view variants while retaining legacy presets.
  • Adds post-appearance settling delays.
  • Adds opaque, alpha-free image snapshots.
  • Adds post-layout preparation hooks for UIKit, AppKit, and SwiftUI.
  • Adds rendered-orientation comparison for visible UIImage pixels.

CustomDump

  • Vendors CustomDump source based on pointfreeco/swift-custom-dump commit 924df7d.
  • Adds standalone CustomDump product with dumping, structural diffing, difference assertions, customization protocols, and platform conformances.
  • Keeps SnapshotTestingCustomDump available for .customDump snapshot and inline snapshot strategies.
  • Adds FoundationNetworking package trait.
  • Adds dedicated upstream MIT license and CustomDump DocC documentation.
  • Adds direct xctest-dynamic-overlay dependency for issue reporting and test support.

Fixes

  • Returns verification failures for invalid or corrupt image references instead of crashing during decode.
  • Treats LF, CRLF, and CR text snapshot line endings as equivalent while preserving stored bytes.
  • Normalizes image pixel formats before comparison.
  • Normalizes UIKit and AppKit image comparison inputs to sRGB.
  • Preserves landscape orientation in image-diff artifacts.
  • Preserves failure attachment content types and UTIs.
  • Records Swift Testing attachments during CLI runs.
  • Fixes WKWebView loading observation and completion.
  • Preserves nested WKWebView and SpriteKit content during temporary-window rendering.
  • Restores native iOS trait overrides on current Xcode versions.
  • Balances view-controller appearance lifecycle callbacks.
  • Uses the active key-window scene when preparing hosted views.
  • Preserves keyboard layout guide geometry and directional layout margins.
  • Moves NSView capture onto the main actor and deterministic scaled windows.
  • Avoids recreating existing snapshot directories, supporting read-only test bundles.

Tests, snapshots, and documentation

  • Adds coverage for typed options, preparation hooks, modern devices, deterministic SwiftUI environments, artifact directories, accessed paths, naming, invalid references, line endings, color spaces, orientation, lifecycle, keyboard geometry, watchOS, and macOS SwiftUI.
  • Adds a dedicated CustomDumpTests target with dump, diff, assertion, and platform-conformance coverage.
  • Updates 209 snapshot reference paths for current platforms and rendering behavior.
  • Reframes README and installation instructions for this fork.
  • Documents requirements, hosted rendering, simulator preflight checks, CustomDump products, and new configuration APIs.

Tooling and CI

  • Adds SwiftFormat, SwiftLint, Mint, Brew, and xcbeautify configuration.
  • Adds local setup, lint, format, watchOS, and expanded cross-platform test targets.
  • Updates CI to macOS 26/Xcode 26.4.1 and Swift 6.3 on Linux and Android.
  • Removes standalone format and release workflows.

Diff summary

  • 51 commits
  • 339 files changed
  • 22,040 insertions and 9,439 deletions

Full comparison