Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

When an expect fails (resulting in an error), the response is lost. #30

Closed
mkasberg opened this issue Jun 29, 2016 · 1 comment
Closed

Comments

@mkasberg
Copy link

Suppose we expect a 200, but actually get a 422 (or some other error code), with info about the error in the response.

return request(app)
  .get("/user")
  .expect(200)
  .then(function (res) {
    // Do stuff ...
  })
  .catch(function (err) {
    // PROBLEM. Don't have response from server.
  });

If we go into the catch, there's no way to print the server's response.

@hyzhak
Copy link

hyzhak commented Jul 1, 2016

definitely should be in a lib

@benesch benesch closed this as completed in a02c038 Jul 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants