def test_user_config(mocker, cli_runner, user_config_path) -> None:
    """Test cli invocation works with `config-file` option."""
    mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')

    template_path = 'tests/fake-repo-pre/'
    result = cli_runner(template_path, '--config-file', user_config_path)

    assert result.exit_code == 0
    mock_cookiecutter.assert_called_once_with(
        template_path,
        None,
        False,
        replay=False,
        overwrite_if_exists=False,
        skip_if_file_exists=False,
        output_dir='.',
        config_file=user_config_path,
        default_config=False,
        extra_context=None,
        password=None,
        directory=None,
        accept_hooks=True,
        keep_project_on_failure=False,
    )
Test cli invocation works with `config-file` option.
tests/test_cli.py