@@ -388,6 +388,26 @@ extension Effect {
388
388
extension Effect {
389
389
/// An effect that causes a test to fail if it runs.
390
390
///
391
+ /// > Important: This Combine-based interface has been soft-deprecated in favor of Swift
392
+ /// > concurrency. Prefer using async functions and `AsyncStream`s directly in your dependencies,
393
+ /// > and using `XCTUnimplemented` from the [XCTest Dynamic Overlay](gh-xctest-dynamic-overlay)
394
+ /// > library to stub in a function that fails when invoked:
395
+ /// >
396
+ /// > ```swift
397
+ /// > struct NumberFactClient {
398
+ /// > var fetch: (Int) async throws -> String
399
+ /// > }
400
+ /// >
401
+ /// > extension NumberFactClient {
402
+ /// > static let unimplemented = Self(
403
+ /// > fetch: XCTUnimplemented(
404
+ /// > "\(Self.self).fetch",
405
+ /// > placeholder: "Not an interesting number."
406
+ /// > )
407
+ /// > }
408
+ /// > }
409
+ /// > ```
410
+ ///
391
411
/// This effect can provide an additional layer of certainty that a tested code path does not
392
412
/// execute a particular effect.
393
413
///
@@ -464,9 +484,15 @@ extension Effect {
464
484
/// made the test easier to understand at the same time. We can see, without consulting the
465
485
/// reducer itself, that this particular action should not access this effect.
466
486
///
487
+ /// [gh-xctest-dynamic-overlay]: http://github.com/pointfreeco/xctest-dynamic-overlay
488
+ ///
467
489
/// - Parameter prefix: A string that identifies this scheduler and will prefix all failure
468
490
/// messages.
469
491
/// - Returns: An effect that causes a test to fail if it runs.
492
+ @available ( iOS, deprecated: 9999.0 , message: " Call 'XCTUnimplemented' from your dependencies, instead. " )
493
+ @available ( macOS, deprecated: 9999.0 , message: " Call 'XCTUnimplemented' from your dependencies, instead. " )
494
+ @available ( tvOS, deprecated: 9999.0 , message: " Call 'XCTUnimplemented' from your dependencies, instead. " )
495
+ @available ( watchOS, deprecated: 9999.0 , message: " Call 'XCTUnimplemented' from your dependencies, instead. " )
470
496
public static func unimplemented( _ prefix: String ) -> Self {
471
497
. fireAndForget {
472
498
XCTFail ( " \( prefix. isEmpty ? " " : " \( prefix) - " ) An unimplemented effect ran. " )
0 commit comments