Skip to content

Commit

Permalink
lint it
Browse files Browse the repository at this point in the history
  • Loading branch information
rlindner81 committed Dec 6, 2024
1 parent a6d7721 commit f9ff526
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/shared/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ describe("request", () => {
mockFetchLib.mockReturnValueOnce(baseOkResponse);
await request({ url: "https://server", pathname: "/path" });
expect(mockFetchLib.mock.calls).toMatchSnapshot();
expect(outputFromLoggerWithTimestamps(mockLogger.info.mock.calls)).toMatchInlineSnapshot(`"GET https://server/path 200 OK (0ms)"`);
expect(outputFromLoggerWithTimestamps(mockLogger.info.mock.calls)).toMatchInlineSnapshot(
`"GET https://server/path 200 OK (0ms)"`
);
});

test("basic bad request", async () => {
Expand All @@ -41,7 +43,9 @@ describe("request", () => {
failure reason]
`);
expect(mockFetchLib.mock.calls).toMatchSnapshot();
expect(outputFromLoggerWithTimestamps(mockLogger.info.mock.calls)).toMatchInlineSnapshot(`"GET https://server/path 400 Bad Request (0ms)"`);
expect(outputFromLoggerWithTimestamps(mockLogger.info.mock.calls)).toMatchInlineSnapshot(
`"GET https://server/path 400 Bad Request (0ms)"`
);
});

test("bad request unchecked", async () => {
Expand Down Expand Up @@ -85,6 +89,8 @@ describe("request", () => {
redirect: true,
});
expect(mockFetchLib.mock.calls).toMatchSnapshot();
expect(outputFromLoggerWithTimestamps(mockLogger.info.mock.calls)).toMatchInlineSnapshot(`"GET https://server/path?hello=world&foo=bar#hashed 200 OK (0ms)"`);
expect(outputFromLoggerWithTimestamps(mockLogger.info.mock.calls)).toMatchInlineSnapshot(
`"GET https://server/path?hello=world&foo=bar#hashed 200 OK (0ms)"`
);
});
});

0 comments on commit f9ff526

Please sign in to comment.