Skip to content

Commit

Permalink
test: reproduction for #268
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Apr 22, 2021
1 parent 44d40c8 commit 414137d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions test/typescript-validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,24 @@ import { createAppAuth } from "../src";

function expectType<T>(what: T) {}

export async function readmeExample() {
const auth = createAppAuth({
appId: 1,
privateKey: "-----BEGIN PRIVATE KEY-----\n...",
clientId: "lv1.1234567890abcdef",
clientSecret: "1234567890abcdef12341234567890abcdef1234",
});
const auth = createAppAuth({
appId: 1,
privateKey: "-----BEGIN PRIVATE KEY-----\n...",
clientId: "lv1.1234567890abcdef",
clientSecret: "1234567890abcdef12341234567890abcdef1234",
});

export async function readmeExample() {
// Retrieve an oauth-access token
const userAuthentication = await auth({ type: "oauth-user", code: "123456" });

expectType<"token">(userAuthentication.type);
}

export async function issue268() {
// Retrieve an oauth-access token
const userAuthentication = await auth({ type: "installation" });

expectType<"token">(userAuthentication.type);
expectType<"tokenType">(userAuthentication.tokenType);
}

0 comments on commit 414137d

Please sign in to comment.