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

[Feature]: Improve Formatting of Assertion Error Messages #34044

Open
hardeep-qa opened this issue Dec 17, 2024 · 0 comments
Open

[Feature]: Improve Formatting of Assertion Error Messages #34044

hardeep-qa opened this issue Dec 17, 2024 · 0 comments

Comments

@hardeep-qa
Copy link

hardeep-qa commented Dec 17, 2024

🚀 Feature Request

Currently, assertion error messages can be difficult to read, especially when dealing with complex data structures. This hinders debugging and troubleshooting efforts.

For example, the assertion:
expect(message).toHaveLength(0);

Produces the following output:

Expected length: 0
Received length: 1
Received array: [{"criticality": {"level": "NON_BREAKING"}, "message": "Field 'product' was added to object type 'Query'", "meta": {"addedFieldName": "product", "typeName": "Query", "typeType": "object type"}]

This raw output of 'Received array' is not easy to read and can make it time-consuming to identify the root cause of the error.

Proposed Solution:
Introduce a feature to format assertion error messages or format it by default, making them more readable and developer-friendly.

Image

Example

No response

Motivation

Format assertion error messages or format it by default, making them more readable and developer-friendly.

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

No branches or pull requests

2 participants