MCPcopy Index your code
hub / github.com/github/github-mcp-server / assertContextHasError

Function assertContextHasError

pkg/errors/error_test.go:479–485  ·  view source on GitHub ↗

assertContextHasError asserts that exactly one error is stored in ctx and it matches expectedErr. nolint:revive // t must be first for test helpers; context-as-argument doesn't apply here

(t *testing.T, ctx context.Context, expectedErr error)

Source from the content-addressed store, hash-verified

477//
478//nolint:revive // t must be first for test helpers; context-as-argument doesn't apply here
479func assertContextHasError(t *testing.T, ctx context.Context, expectedErr error) {
480 t.Helper()
481 apiErrors, err := GetGitHubAPIErrors(ctx)
482 require.NoError(t, err)
483 require.Len(t, apiErrors, 1)
484 assert.Equal(t, expectedErr, apiErrors[0].Err)
485}
486
487func TestNewGitHubAPIErrorResponse_RateLimits(t *testing.T) {
488 t.Run("RateLimitError produces clean message with retry time", func(t *testing.T) {

Calls 1

GetGitHubAPIErrorsFunction · 0.85

Tested by

no test coverage detected