Skip to content

Conversation

@timmywil
Copy link
Member

Summary

Add the actual and expected messages to the reporter.

Also, I realized that test.errors contained all the failed assertions and test.assertions contained only passed ones, so I was able to clean up that code a bit.

Checklist

@timmywil timmywil requested a review from mgol March 14, 2024 00:17
@timmywil timmywil added the Tests label Mar 14, 2024
@timmywil timmywil added this to the 4.0.0 milestone Mar 14, 2024
Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving but I'd love to see proper diffing in the console; sometimes it can really help.

Comment on lines +26 to +27
message += `\nexpected: ${ JSON.stringify( error.expected ) }`;
message += `\nactual: ${ chalk.red( JSON.stringify( error.actual ) ) }`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also do a diff? It can be helpful when comparing objects. It's quite easy to do with the diff package; a colored example: https://www.npmjs.com/package/diff#basic-example-in-node

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, feel free to tackle this in a separate PR; it may even be cleaner to have the diffing feature in a separate commit on main.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we'll do that in another PR.

@timmywil timmywil merged commit 1e84908 into jquery:main Mar 14, 2024
@timmywil timmywil deleted the reporter branch March 14, 2024 13:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

2 participants