stubDeps is a test helper that implements ToolDependencies with configurable behavior. Use this when you need to test error paths or when you need closure-based client creation.
| 26 | // stubDeps is a test helper that implements ToolDependencies with configurable behavior. |
| 27 | // Use this when you need to test error paths or when you need closure-based client creation. |
| 28 | type stubDeps struct { |
| 29 | clientFn func(context.Context) (*gogithub.Client, error) |
| 30 | gqlClientFn func(context.Context) (*githubv4.Client, error) |
| 31 | rawClientFn func(context.Context) (*raw.Client, error) |
| 32 | |
| 33 | repoAccessCache *lockdown.RepoAccessCache |
| 34 | t translations.TranslationHelperFunc |
| 35 | flags FeatureFlags |
| 36 | contentWindowSize int |
| 37 | obsv observability.Exporters |
| 38 | } |
| 39 | |
| 40 | func (s stubDeps) GetClient(ctx context.Context) (*gogithub.Client, error) { |
| 41 | if s.clientFn != nil { |
nothing calls this directly
no outgoing calls
no test coverage detected