Skip to content

Xcode 16 - SnapshotTesting in a Swift Package #879

Open
@kelvinlauKL

Description

@kelvinlauKL

I'm building a UI library as a Swift Package. Attempting to use SnapshotTesting gives me this:

Screenshot 2024-07-28 at 8 38 23 PM

Here's my package file:

// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
  name: "ChatDesignSystem",
  platforms: [.macOS(.v15), .iOS(.v18), .tvOS(.v18), .watchOS(.v11), .macCatalyst(.v18)],
  products: [
    .library(
      name: "ChatDesignSystem",
      targets: ["ChatDesignSystem"]),
  ],
  dependencies: [
    .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", branch: "main")
  ],
  targets: [
    .target(
      name: "ChatDesignSystem"),
    .testTarget(
      name: "ChatDesignSystemTests",
      dependencies: [
        "ChatDesignSystem",
        .product(name: "SnapshotTesting", package: "swift-snapshot-testing")
      ]
    ),
  ]
)

Is this not supported in a Swift Package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions