Skip to content

RequestPromiseResponse json body #80

@ludeknovy

Description

@ludeknovy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions