supertest icon indicating copy to clipboard operation
supertest copied to clipboard

Keep getting error: "invalid json response body at reason: Unexpected end of JSON input"

Open eden-lane opened this issue 4 years ago • 1 comments

 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);

eden-lane avatar Jan 20 '21 12:01 eden-lane

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.

Dipesh-Das97 avatar May 29 '21 16:05 Dipesh-Das97