Skip to content

Commit

Permalink
test: handle baseUrl suffix for GHES
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Sep 9, 2020
1 parent 9614edf commit d35209a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,30 @@ describe("graphql.defaults()", () => {
expect(result).toStrictEqual(mockData);
});
});

it.only("handle baseUrl set with /api/v3 suffix", () => {
const ghesGraphQl = graphql.defaults({
baseUrl: "https://github.acme-inc.com/api/v3",
headers: {
authorization: `token secret123`,
},
request: {
fetch: fetchMock.sandbox().post(
"https://github.acme-inc.com/api/graphql",
{ data: { ok: true } },
{
headers: {
authorization: "token secret123",
},
}
),
},
});

return ghesGraphQl(`query {
viewer {
login
}
}`);
});
});

0 comments on commit d35209a

Please sign in to comment.