Skip to content

Commit

Permalink
👕 #44 Prettierのデフォルトルールが変わったのでFormatterを再適応
Browse files Browse the repository at this point in the history
  • Loading branch information
keitakn committed Jul 7, 2023
1 parent 8c58d19 commit 93f27fe
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/api/client/__tests__/fetchCatMessage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('src/api/client/fetchCatMessage.ts fetchCatMessage TestCases', () => {

it('should InvalidResponseBodyError Throw, because unexpected response body', async () => {
mockServer.use(
rest.post('/api/cats', mockFetchCatMessageUnexpectedResponseBody)
rest.post('/api/cats', mockFetchCatMessageUnexpectedResponseBody),
);

const dto = {
Expand All @@ -51,7 +51,7 @@ describe('src/api/client/fetchCatMessage.ts fetchCatMessage TestCases', () => {
} as const;

await expect(fetchCatMessage(dto)).rejects.toThrow(
InvalidResponseBodyError
InvalidResponseBodyError,
);
});
});
6 changes: 3 additions & 3 deletions src/app/api/cats/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const runtime = 'edge';

export async function POST(request: NextRequest): Promise<NextResponse> {
const { success } = await rateLimit.limit(
request.ip != null ? request.ip : 'anonymous'
request.ip != null ? request.ip : 'anonymous',
);

if (!success) {
Expand All @@ -51,14 +51,14 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
headers: {
'Content-Type': 'application/json',
Authorization: `Basic ${String(
process.env.API_BASIC_AUTH_CREDENTIALS
process.env.API_BASIC_AUTH_CREDENTIALS,
)}`,
},
body: JSON.stringify({
userId: requestBody.userId,
message: requestBody.message,
}),
}
},
);
const responseBody = (await response.json()) as ResponseBody;

Expand Down
4 changes: 2 additions & 2 deletions src/app/chat/[catId]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const generateMetadata = async (
// eslint-disable-next-line
{ params }: Props,
// eslint-disable-next-line
parent: ResolvingMetadata
parent: ResolvingMetadata,
): Promise<Metadata> => {
if (!isCatId(params.catId)) {
notFound();
Expand All @@ -28,7 +28,7 @@ export const generateMetadata = async (
return {
title: `AI Cat ${extractCatNameById(params.catId)}ちゃん🐱`,
description: `ねこのAI(${extractCatNameById(
params.catId
params.catId,
)})とお話しよう🐱`,
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('src/app/chat/_components/ChatContent/ChatHeader.tsx TestCases', () =>

expect(screen.getByRole('img', { name: expectedCatName })).toHaveAttribute(
'alt',
expectedCatName
expectedCatName,
);

expect(screen.getByText(expectedCatName)).toBeInTheDocument();
Expand Down
2 changes: 1 addition & 1 deletion src/features/__tests__/cat/extractCatNameById.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('src/features/cat.ts extractCatNameById TestCases', () => {
'should return catName. catId: $catId',
({ catId, expected }: TestTable) => {
expect(extractCatNameById(catId)).toStrictEqual(expected);
}
},
);

it.each`
Expand Down
2 changes: 1 addition & 1 deletion src/features/cat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type FetchCatMessageResponse = {
};

export type FetchCatMessage = (
dto: FetchCatMessageDto
dto: FetchCatMessageDto,
) => Promise<FetchCatMessageResponse>;

export const extractCatNameById = (catId: CatId): CatName => {
Expand Down
2 changes: 1 addition & 1 deletion src/mocks/api/internal/cats/mockFetchCatMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export const mockFetchCatMessage: ResponseResolver<
ctx.json({
message:
'こんにちは🐱もことお話しようにゃん🐱お名前を教えてほしいにゃん🐱',
})
}),
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export const mockFetchCatMessageUnexpectedResponseBody: ResponseResolver<
ctx.json({
catMessageText:
'こんにちは🐱もことお話しようにゃん🐱お名前を教えてほしいにゃん🐱',
})
}),
);
};
2 changes: 1 addition & 1 deletion src/utils/sleep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const millisecond = 1000;
const defaultWaitSeconds = 1;

export const sleep = async (
waitSeconds: number = defaultWaitSeconds
waitSeconds: number = defaultWaitSeconds,
): Promise<void> => {
await new Promise<void>((resolve) => {
setTimeout(() => {
Expand Down

0 comments on commit 93f27fe

Please sign in to comment.