You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: SuperTest doesn't seem to pass the body as is. In particular, if it is invalid, it sends an empty JSON object to the endpoint.
Is this intended? It seems like it would be useful to accept invalid bodies to test the behaviour in those cases.
Actual behavior
ie. let res = await request.post('/hello/').send('bye');
Endpoint receives a request that has a body of {}
Expected behavior
let res = await request.post('/hello/').send('bye');
Endpoint receives a request that has a body of 'bye', even if it is technically invalid.
Code to reproduce
Behaviour seems similar to what was reported here too: #189 (comment)
It may be of note that the endpoint receives an empty JSON object when the request body is being parsed by a middleware (both body-parser or express' parser).
Checklist
I have searched through GitHub issues for similar issues.
I have completely read through the README and documentation.
I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
The text was updated successfully, but these errors were encountered:
Describe the bug
Node.js version: v18.8.0
OS version:
Description: SuperTest doesn't seem to pass the body as is. In particular, if it is invalid, it sends an empty JSON object to the endpoint.
Is this intended? It seems like it would be useful to accept invalid bodies to test the behaviour in those cases.
Actual behavior
ie.
let res = await request.post('/hello/').send('bye');
Endpoint receives a request that has a body of
{}
Expected behavior
let res = await request.post('/hello/').send('bye');
Endpoint receives a request that has a body of
'bye'
, even if it is technically invalid.Code to reproduce
Behaviour seems similar to what was reported here too: #189 (comment)
It may be of note that the endpoint receives an empty JSON object when the request body is being parsed by a middleware (both
body-parser
orexpress
' parser).Checklist
The text was updated successfully, but these errors were encountered: