From 41e461bbf2cae444eea2597f005a2b6765749178 Mon Sep 17 00:00:00 2001 From: Nicolas Ayral Seydoux Date: Fri, 23 Aug 2024 11:03:10 +0200 Subject: [PATCH] Lint --- src/http/errorResponse.mock.ts | 13 +++++++------ src/http/problemDetails.mock.ts | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/http/errorResponse.mock.ts b/src/http/errorResponse.mock.ts index 553097d..29b9ce4 100644 --- a/src/http/errorResponse.mock.ts +++ b/src/http/errorResponse.mock.ts @@ -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. diff --git a/src/http/problemDetails.mock.ts b/src/http/problemDetails.mock.ts index 8b72338..4c0b95f 100644 --- a/src/http/problemDetails.mock.ts +++ b/src/http/problemDetails.mock.ts @@ -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, },