Always interesting to hear different points of view on this subject. Personally I think mocks make sense to capture complex sets of interactions or otherwise difficult to reach error conditions, so I don’t think it’s a do or do-not kind of thing.

  • technologenesis@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Mocking and dependency injection don’t seem to be mutually exclusive, if anything dependency injection can make it easier to get the component you’re testing to interface with the mock