mokacoding

unit and acceptance testing, automation, productivity

Posts tagged "combine"

When to test a @Published property using sink

Swift @Published properties come with an associated Combine Publisher that emits values over time. This free XCTest tutorial explains when to write a unit test that accesses the property directly and when it's instead necessary to subscribe to it using the sink operator.

Unit Testing Combine Publisher Cheatsheet

Snippets to test the behavior of Combine Publishers in XCTest ready to copy and paste into Xcode