Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rejectedWith Gives GIANT unreadable message (for humans) when fails #232

Open
robertleeplummerjr opened this issue Mar 21, 2019 · 0 comments

Comments

@robertleeplummerjr
Copy link

I have a failing unit test that, when used with rejectedWith via:

describe('Super Getter', () => {
  it('should fail to 401', () => {
    return (new SuperGetter()).get().should.be.rejectedWith({ response: { status: 401 } });
  });
});

In the above simplified example, I'm getting a 403. the only thing I care about is if the response.status matches that of what the actual error is. But instead I get an 18,000 line message (it is actually longer) of the thing it is expecting. This is a gross overflow of information that nobody cares about and should be a simple 1 or 2 line of the following:

AssertionError: expected [Promise] to be rejected: expected error.response.status = 401, to match error.response.status = 403

Can this be simplified to valuable information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant