We’ve all walked the burning sands of the ‘Green Test, Broken Production’ mirage. Watching a sea of green is comforting, but it is a hollow victory. The true test comes when the code meets the deep desert of production and withers, leaving us to find that a mock ceased to reflect reality months ago…
How does this library handle control flow? For example, how can I fetch results from the DB, then for each result, execute one of several different pipelines depending on properties of that entity?
You can handle complex branching using standard JavaScript. Since every pipeline is just a function returning data, you can use if/else or map to return different sub-pipelines and commands from within your logic functions. Here’s an example: