supertest
supertest copied to clipboard
Keep getting error: "invalid json response body at reason: Unexpected end of JSON input"
FetchError: invalid json response body at reason: Unexpected end of JSON input
at node_modules/node-fetch/lib/index.js:272:32
Here is my code:
const response = await request(app)
.get('/api/demos')
.expect(200);
I have faced the same issue with Wretch API. Instead I try to look at the raw response as a solution. If there is a solution with response.json() it would be great.