Skip to content

Commit 9a70318

Browse files
committed
chore: apply eslint rules
1 parent ec1ede1 commit 9a70318

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/handler/APIGatewayProxyHandler.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
BadRequestError,
1111
UnauthorizedError,
1212
} from "../error";
13-
import { ok, created, noContent } from '../response'
13+
import { ok, created, noContent } from "../response";
1414
import * as ContextFactory from "../../test/fixtures/ContextFactory";
1515
import * as APIGatewayProxyEventFactory from "../../test/fixtures/APIGatewayProxyEventFactory";
1616

@@ -27,28 +27,28 @@ describe(APIGatewayProxyHandler.name, () => {
2727

2828
it("handles HTTP 200 response correctly", async () => {
2929
const fn = handler.wrapper(() => {
30-
return ok({ result: "HTTP 200" })
30+
return ok({ result: "HTTP 200" });
3131
}) as Handler<APIGatewayProxyEvent, APIGatewayProxyResult>;
3232

33-
const result = await fn(event, context, () => {});
33+
const result = await fn(event, context, () => undefined);
3434
expect(result).toMatchSnapshot();
3535
});
3636

3737
it("handles HTTP 201 response correctly", async () => {
3838
const fn = handler.wrapper(() => {
39-
return created({ result: "HTTP 201" })
39+
return created({ result: "HTTP 201" });
4040
}) as Handler<APIGatewayProxyEvent, APIGatewayProxyResult>;
4141

42-
const result = await fn(event, context, () => {});
42+
const result = await fn(event, context, () => undefined);
4343
expect(result).toMatchSnapshot();
4444
});
4545

4646
it("handles HTTP 204 response correctly", async () => {
4747
const fn = handler.wrapper(() => {
48-
return noContent()
48+
return noContent();
4949
}) as Handler<APIGatewayProxyEvent, APIGatewayProxyResult>;
5050

51-
const result = await fn(event, context, () => {});
51+
const result = await fn(event, context, () => undefined);
5252
expect(result).toMatchSnapshot();
5353
});
5454

src/handler/APIGatewayProxyHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class APIGatewayProxyHandler extends BaseHandler {
8080
protected formatOutput(result: APIGatewayResponse): APIGatewayProxyResult {
8181
const { body, ...properties } = result;
8282
return {
83-
body: this.outputFormat.apply(body ?? ""),
83+
...(body && { body: this.outputFormat.apply(body) }),
8484
...properties,
8585
};
8686
}

0 commit comments

Comments
 (0)