Skip to content

Commit

Permalink
feat(endpoints): update endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
OllieJennings committed May 18, 2024
1 parent fb79e79 commit 6a12197
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 522 deletions.
43 changes: 43 additions & 0 deletions __tests__/unit/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,49 @@ describe("RiotAPI", () => {
);
});

describe("spectatorTftV5", () => {
test.each([
[
"getByPuuid",
{
region: PlatformId.EUW1,
puuid: "1",
},
[
PlatformId.EUW1,
RiotAPITypes.METHOD_KEY.SPECTATOR_TFT_V5.GET_GAME_BY_PUUID,
{ puuid: "1" },
{
id: "euw1.spectatorTftV5.getByPuuidId.1",
},
],
],
[
"getFeaturedGames",
{
region: PlatformId.EUW1,
},
[
PlatformId.EUW1,
RiotAPITypes.METHOD_KEY.SPECTATOR_TFT_V5.GET_FEATURED_GAMES,
{},
{
id: "euw1.spectatorTftV5.getFeaturedGames",
},
],
],
])(
"%s - calls request with correct params",
async (name, input, params) => {
const rAPI = new RiotAPI("1234");
rAPI.request = jest.fn().mockResolvedValue(null);

await getKeyValue(rAPI.spectatorTftV5)(name as any)(input as any);
expect(rAPI.request).toHaveBeenCalledWith(...params);
}
);
});

describe("spectator", () => {
test.each([
[
Expand Down
Loading

0 comments on commit 6a12197

Please sign in to comment.