Skip to content

Commit

Permalink
Fix build error when using UI Tests
Browse files Browse the repository at this point in the history
Thanks PointFree for documenting a fix.
  • Loading branch information
younata committed Oct 13, 2024
1 parent cecacf0 commit ac141cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Nimble/Adapters/NimbleSwiftTestingHandler.swift
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit ac141cc

Please sign in to comment.