anchor.diff:      Result = wait_for_result(Conn),
       escalus_connection:stop(Conn),
       Result.
  +
  +auth_type(Config) ->
  +    Type = case {escalus_config:get_config(escalus_auth, Config, undefined),
  +                 try_check_mod_register(Config)} of
  +               {{module, _} = M, _} -> M;
  +               {_, true} -> xmpp;
  +               {_, false} -> ejabberd
  +           end,
  +    {escalus_auth, Type}.
  +
  +try_check_mod_register(Config) ->
  +    try is_mod_register_enabled(Config)
  +    catch _ -> false
  +    end.
   
   is_mod_register_enabled(Config) ->
       Server = escalus_config:get_config(escalus_server, Config, <<"localhost">>),
  
positive.code: 
  delete_users(Config, Who) ->
      Users = case Who of
          config ->
              escalus_config:get_config(escalus_users, Config, []);
          _ ->
              get_users(Who)
      end,
  
      case is_mod_register_enabled(Config) of
          true ->
              [delete_user(Config, User) || User <- Users];
          _ ->
              escalus_ejabberd:delete_users(Config, Users)
      end.
  
  get_jid(Config, User) ->
      Username = get_username(Config, User),
      Server = get_server(Config, User),
  
negative.code:          verify_creation/1,
           delete_user/2,
           get_usp/2,
           is_mod_register_enabled/1
          ]).
  
  % Public Types
  -type spec() :: [{escalus_config:key(), any()}].
  