diff --git a/dist/index.js b/dist/index.js index b034fa09..f71cb11d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -42350,7 +42350,12 @@ function baseBranchTip(octokit, context, branch) { function getErrorDetails(error) { if (typeof error === 'object' && error !== null) { + // @octokit/request wraps every rejection the bundle can see in a RequestError, which always carries a + // numeric status and a string message; the status-less and message-less arms are reached only by + // hand-built objects, so each statement is ignored as a whole (an arm-level hint leaves the && branch) + /* v8 ignore next -- status-less object arm unreachable from dist/index.js; auth.test.ts drives it */ const status = 'status' in error ? error.status : 'unknown'; + /* v8 ignore next -- message-less object arm unreachable from dist/index.js; auth.test.ts drives it */ const message = 'message' in error && typeof error.message === 'string' ? error.message : String(error); diff --git a/docs/contributing.md b/docs/contributing.md index 075aa352..5f1ccc83 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -61,7 +61,7 @@ check then proves that the bundle the harness just exercised matches `src/`. ### Phantom "uncovered" branches after an `await` The unit run lists four branches as uncovered that every test run in fact -drives: `close.ts:39`, `reopen.ts:36`, `approve.ts:504` and `auth.ts:220` +drives: `close.ts:39`, `reopen.ts:36`, `approve.ts:504` and `auth.ts:225` (it reports 1652/1656 branches because of them; the e2e run repeats the last two). Each is an `if` with no `else` whose condition was assigned from an expression in which an `await` is only sometimes reached (`a || (await b())`, diff --git a/src/utils/auth.ts b/src/utils/auth.ts index f5d5d1f9..63afe923 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -12,7 +12,12 @@ import { loadPullRequestOwners } from './pullRequestOwners' function getErrorDetails(error: unknown): { status: unknown, message: string } { if (typeof error === 'object' && error !== null) { + // @octokit/request wraps every rejection the bundle can see in a RequestError, which always carries a + // numeric status and a string message; the status-less and message-less arms are reached only by + // hand-built objects, so each statement is ignored as a whole (an arm-level hint leaves the && branch) + /* v8 ignore next -- status-less object arm unreachable from dist/index.js; auth.test.ts drives it */ const status = 'status' in error ? error.status : 'unknown' + /* v8 ignore next -- message-less object arm unreachable from dist/index.js; auth.test.ts drives it */ const message = 'message' in error && typeof error.message === 'string' ? error.message