Skip to content

Commit

Permalink
refactor: remove log argument from auth.ts to improve test coverage (
Browse files Browse the repository at this point in the history
…#1887)

chore: simplify auth.ts
  • Loading branch information
Uzlopak committed Nov 12, 2023
1 parent 4100b25 commit 4699a3c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/auth.ts
@@ -1,5 +1,3 @@
import type { Logger } from "pino";

import { getAuthenticatedOctokit } from "./octokit/get-authenticated-octokit";
import { ProbotOctokit } from "./octokit/probot-octokit";
import type { State } from "./types";
Expand All @@ -20,6 +18,7 @@ import type { State } from "./types";
* });
* };
* ```
* @param state - Probot application instance state, which is used to persist
*
* @param id - ID of the installation, which can be extracted from
* `context.payload.installation.id`. If called without this parameter, the
Expand All @@ -32,10 +31,6 @@ import type { State } from "./types";
export async function auth(
state: State,
installationId?: number,
log?: Logger,
): Promise<InstanceType<typeof ProbotOctokit>> {
return getAuthenticatedOctokit(
Object.assign({}, state, log ? { log } : null),
installationId,
);
return getAuthenticatedOctokit(Object.assign({}, state), installationId);
}

0 comments on commit 4699a3c

Please sign in to comment.