nsscreencast / comments

Public comments on NSScreencast.com
0 stars 0 forks source link

Why Coordinators? - NSScreencast #183

Open subdigital opened 3 years ago

subdigital commented 3 years ago

Written on 10/11/2017 18:42:02

URL: https://nsscreencast.com/episodes/268-coordinators

subdigital commented 3 years ago

originally written by Deny on 02/14/2019 12:00:20

How do you test coordinators? If you have some dependencies in it, do you inject them in initialiser? For example, you can have some authentication service which will influence if the flow will continue to login screen or directly to main app screen. So you call start method in coordinator and now you have two possible paths.
Only way how to test this is inject authentication service and replace it with stub in tests. Then you can check the navigation stack or child view controllers stack if navigation flow works but it's not ideal :-/