Skip to content

Commit

Permalink
Add test for handling if langlinks is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Govind S committed Jan 13, 2024
1 parent b0b774a commit c65a4fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/langlinks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ test('Returns empty if no lang links are available', async () => {
expect(result).toStrictEqual([]);
});

test('Returns empty if lang links object itself is not available', async () => {
requestMock.mockImplementation(async () => { return { query: { pages: {404: {}} } } });
const result = await langLinks("Test");
expect(result).toStrictEqual([]);
});

test('Returns with results an array of langLinksResult object', async () => {
requestMock.mockImplementation(async () => { return { query: { pages: langLinkskMock } } });
const result = await langLinks("Test");
Expand Down

0 comments on commit c65a4fc

Please sign in to comment.