Overriding Service Dependencies in a Layer for Testing

Is there a way for one to override a service dependency in a Layer? Say I have already constructed a layer like this:
const IngredientsLive = Layer.merge(FlourLive, SugarLive)
 
const MainLive = RecipeLive.pipe(
  Layer.provide(IngredientsLive),
  Layer.provideMerge(MeasuringCupLive)
  //Dozens of other Service Dependencies...
)

Then for testing purposes I wish to create a new Layer (using MainLive) where I provide a failing implementation of MeasuringCup. I wish to use the existing MainLive to save me from building the entire service stack again.
MainLive.pipe(
  Layer.provide(MeasuringCupFailure)
)

I've tested that this does not replace the MeasuringCupLive implementation. Am I missing something? This is something I would think is useful.
Was this page helpful?