Skip to content

Commit

Permalink
test: github.ae
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Sep 15, 2021
1 parent 0689061 commit 69ad795
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/js/github.ae/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
35 changes: 35 additions & 0 deletions tests/js/github.ae/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { expectType, expectNotType } from "tsd";

import { Octokit } from "@octokit-next/core";

import "@octokit-next/types-rest-api-github.ae";

export async function test() {
const octokit = new Octokit({
version: "github.ae",
});

const dotcomOnlyResponse = await octokit.request(
"GET /marketplace_listing/plans"
);
expectType<never>(dotcomOnlyResponse);

const ghesOnlyResponse = await octokit.request("GET /admin/hooks/{hook_id}", {
hook_id: 1,
mediaType: {
previews: ["superpro"],
},
});
expectType<number | undefined>(ghesOnlyResponse.data.id);
expectType<string>(ghesOnlyResponse.headers["x-github-enterprise-version"]);

const dotcomOnlyResponse2 = await octokit.request(
"GET /marketplace_listing/plans",
{
request: {
version: "github.com",
},
}
);
expectType<number>(dotcomOnlyResponse2.data[0].id);
}

0 comments on commit 69ad795

Please sign in to comment.