mirror of
https://github.com/github/codeql-action.git
synced 2025-12-28 02:00:12 +08:00
26 lines
640 B
TypeScript
26 lines
640 B
TypeScript
import { expectType } from "tsd";
|
|
import githubAppJwt from ".";
|
|
|
|
export async function test() {
|
|
const result = await githubAppJwt({
|
|
id: 123,
|
|
privateKey: "",
|
|
});
|
|
|
|
expectType<number>(result.appId);
|
|
expectType<number>(result.expiration);
|
|
expectType<string>(result.token);
|
|
}
|
|
|
|
// Test case to verify `id` can be set to a string
|
|
export async function testWithStringId() {
|
|
const resultWithStringId = await githubAppJwt({
|
|
id: "client_id_string",
|
|
privateKey: "",
|
|
});
|
|
|
|
expectType<string>(resultWithStringId.appId);
|
|
expectType<number>(resultWithStringId.expiration);
|
|
expectType<string>(resultWithStringId.token);
|
|
}
|