Skip to content

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

@robertleeplummerjr

Description

@robertleeplummerjr

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions