Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
NSeydoux committed Aug 23, 2024
1 parent b8faaf6 commit 41e461b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/http/errorResponse.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ export function mockErrorResponse({
}): WithErrorResponse {
return {
response: {
ok: ok === null ? undefined : ok ?? false,
body: body === null ? undefined : body ?? "Some response body",
status: status === null ? undefined : status ?? 400,
statusText: statusText === null ? undefined : statusText ?? "Bad Request",
url: url === null ? undefined : url ?? "https://example.org/resource",
headers: headers === null ? undefined : headers ?? new Headers(),
ok: ok === null ? undefined : (ok ?? false),
body: body === null ? undefined : (body ?? "Some response body"),
status: status === null ? undefined : (status ?? 400),
statusText:
statusText === null ? undefined : (statusText ?? "Bad Request"),
url: url === null ? undefined : (url ?? "https://example.org/resource"),
headers: headers === null ? undefined : (headers ?? new Headers()),
},
// The type assertion allows us to create invalid error
// responses for unit tests purpose.
Expand Down
6 changes: 3 additions & 3 deletions src/http/problemDetails.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export function mockProblemDetails({
}): WithProblemDetails {
return {
problemDetails: {
type: type === null ? undefined : type ?? DEFAULT_TYPE,
status: status === null ? undefined : status ?? 400,
title: title === null ? undefined : title ?? "Bad Request",
type: type === null ? undefined : (type ?? DEFAULT_TYPE),
status: status === null ? undefined : (status ?? 400),
title: title === null ? undefined : (title ?? "Bad Request"),
detail,
instance,
},
Expand Down

0 comments on commit 41e461b

Please sign in to comment.