ferranabello/Viperit

How to test modules?

Closed this issue · 2 comments

ufeub commented

Hello. Thanks for very useful project.
And how we can test module (presenter, interactor)? We need mock some layers (view for example) but we can't.

Hi @ufeub,
you can check out the tests in the example app to see how they work.

This is an example of injecting a mock view:

var mod = AppModules.home.build()
        view = HomeMockView()
        view.expectation = expectation(description: "Test expectation description")
        mod.injectMock(view: view)
        ....

Let me know if it works for you 👍

Hi @ufeub,
I'll close this issue since you didn't give any feedback.

Feel free to reopen it if necessary.

Cheers.