Describe the bug
RequestPromiseResponse throws TypeError: res.body.replace is not a function. This happens when request is made with json: true, thus the retuned value is not json string but object.
To Reproduce
- Send request with
json: true, i.e: { method: 'GET', json: true, url: 'your-url', resolveWithFullResponse: true, simple: false}
* assert that response with expect(response).toSatisfyApiSpec()
Expected behavior
Handle json without throwing an error.
The problem is on line 7 in RequestPromiseResponse:
this.body = res.body.replace(/"/g, '');
Describe the bug
RequestPromiseResponse throws
TypeError: res.body.replace is not a function. This happens when request is made withjson: true, thus the retuned value is not json string but object.To Reproduce
json: true, i.e:{ method: 'GET', json: true, url: 'your-url', resolveWithFullResponse: true, simple: false}* assert that response with expect(response).toSatisfyApiSpec()
Expected behavior
Handle
jsonwithout throwing an error.The problem is on line 7 in RequestPromiseResponse:
this.body = res.body.replace(/"/g, '');