Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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())`,
Expand Down
5 changes: 5 additions & 0 deletions src/utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading