How do you test middleware? #1908
-
I have a standard middleware implementation like this:
How can I write tests for the handler? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
in general, this way, @brandonk3nt : expect(await authMiddleware.execute({
input: {},
options: {},
request: requestMock,
response: responseMock,
logger: loggerMock
}).toEqual({ }) however, you'd have to make those mocks. |
Beta Was this translation helpful? Give feedback.
-
I started making the helper for that purpose in #1909 |
Beta Was this translation helpful? Give feedback.
-
The feature is available in the recently released v20.4.0, @brandonk3nt |
Beta Was this translation helpful? Give feedback.
The feature is available in the recently released v20.4.0, @brandonk3nt