How does next13's /app routing api integrate Jest testing?
The api routing style I use is export async function POST(), but it is not like an endpoint in /page, which makes it difficult for me to simulate this service as usual
1 Reply
My test code looks like this:
And the types passed in by my POST are the native Request and Response types.
The result is this error:
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: 200
Number of calls: 0
Looks like the request is not being impersonated to run? thus not getting any response.