Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Fixes linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesseanwright committed Sep 4, 2020
1 parent 0262c94 commit b315bd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion reno/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export type ProcessedRequest<TBody> =
* type to be configured via the sole type
* parameter. Defaults to an empty object.
*/
export type JsonRequest<TBody = {}> = ProcessedRequest<TBody>;
export type JsonRequest<TBody = Record<string, unknown>> = ProcessedRequest<
TBody
>;

/**
* A ProcessedRequest with a body type
Expand Down
9 changes: 4 additions & 5 deletions reno/helpers_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ Deno.test({
path: "/",
});

const handlerStub = createHandlerStub<{}>(request, expectedResponse);
const augmentedHandler = withJsonBody<{}>(handlerStub);
const handlerStub = createHandlerStub(request, expectedResponse);
const augmentedHandler = withJsonBody(handlerStub);

// TODO: use assertThrowsAsync
await augmentedHandler(request).catch((e) => {
Expand All @@ -235,9 +235,8 @@ Deno.test({
body,
});

const handlerStub = createHandlerStub<{}>(request);

const augmentedHandler = withJsonBody<{}>(handlerStub);
const handlerStub = createHandlerStub(request);
const augmentedHandler = withJsonBody(handlerStub);

await augmentedHandler(request).catch((e) => {
assertStrictEquals(e instanceof SyntaxError, true);
Expand Down

0 comments on commit b315bd6

Please sign in to comment.