Skip to content

Commit

Permalink
Return valid json in mock method
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Oct 23, 2023
1 parent d09eb97 commit 1a662b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/javascript/code_listing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ beforeEach(async () => {

jest.spyOn(util, "fetch").mockImplementation(() => Promise.resolve({
json: () => Promise.resolve({}),
headers: { get: h => h == "X-Pagination" ? "{ total_pages: 1, current_page: 1 }" : "" },
headers: { get: h => h == "X-Pagination" ? JSON.stringify({ total_pages: 1, current_page: 1 }) : "" },
} as Response ));

// Bootstrap incorrectly detects jquery, so we need to disable it
Expand Down

0 comments on commit 1a662b7

Please sign in to comment.