MCPcopy
hub / github.com/github/github-mcp-server / stubExporters

Function stubExporters

pkg/github/server_test.go:78–81  ·  view source on GitHub ↗

Helper functions to create stub client functions for error testing stubExporters returns a discard-logger + noop-metrics Exporters for tests.

()

Source from the content-addressed store, hash-verified

76
77// stubExporters returns a discard-logger + noop-metrics Exporters for tests.
78func stubExporters() observability.Exporters {
79 obs, _ := observability.NewExporters(slog.New(slog.DiscardHandler), metrics.NewNoopMetrics())
80 return obs
81}
82
83func stubClientFnFromHTTP(t *testing.T, httpClient *http.Client) func(context.Context) (*gogithub.Client, error) {
84 t.Helper()

Calls 2

NewExportersFunction · 0.92
NewNoopMetricsFunction · 0.92

Tested by

no test coverage detected