How do you test Combine pipelines?
The gist
A Combine pipeline is tested like an "inputs → outputs" function: feed in values (a subject, @Published, an API stub), collect what the subscriber received, and compare. Two things get in the way — asynchrony (values arrive later) and time (debounce, delay, throttle, timeout). Both are solved by injection: dependencies return synchronous publishers (Just, Fail, a subject), and the scheduler is passed in from outside.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep