From 566294c3d05b88506ab63423d7225b5cbebce27d Mon Sep 17 00:00:00 2001 From: Rachel Brindle Date: Sun, 13 Oct 2024 16:39:16 -0700 Subject: [PATCH] Fix build error when using UI Tests (#1164) Thanks PointFree for documenting a fix. --- Sources/Nimble/Adapters/NimbleSwiftTestingHandler.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Nimble/Adapters/NimbleSwiftTestingHandler.swift b/Sources/Nimble/Adapters/NimbleSwiftTestingHandler.swift index ebd2aa11c..bf86bb6d5 100644 --- a/Sources/Nimble/Adapters/NimbleSwiftTestingHandler.swift +++ b/Sources/Nimble/Adapters/NimbleSwiftTestingHandler.swift @@ -1,6 +1,10 @@ import Foundation #if canImport(Testing) -import Testing +// See https://github.com/pointfreeco/swift-snapshot-testing/discussions/901#discussioncomment-10605497 +// tl;dr: Swift Testing is not available when using UI tests. +// And apparently `private import` - the preferred way to do this - doesn't work. +// So we use a deprecated approach that does work with this. +@_implementationOnly import Testing #endif public class NimbleSwiftTestingHandler: AssertionHandler {