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

Add note about zero width space #14002

Closed
wants to merge 1 commit into from
Closed

Conversation

ibuibu
Copy link
Contributor

@ibuibu ibuibu commented Mar 11, 2023

Summary

Added the ability to display a NOTE for toEqual(), toStrictEqual() and toBe() when the test fails due to the presence of a zero-width space.

Related

#10584

#13997

Test plan

Test
image

Result

image

@SimenB
Copy link
Member

SimenB commented Apr 8, 2023

@ibuibu thanks for sending a PR! Wouldn't #13997 be better?

@ibuibu
Copy link
Contributor Author

ibuibu commented Apr 13, 2023

@SimenB Yes, it is a simple implementation and a good visual representation.

I have three concerns.

  • It is difficult to know that it is a ZERO-WIDTH-SPACE because it is displayed as just a space. I thought it would be better to convey this point in the Note as well, as per my PR.

  • Only FEFF has been targeted for replacement. However, there are other character codes that are zero-width-space.

  • Only the first zero-width-space found is replaced. This is an issue that applies to my PR. However, I thought it might be possible to solve this problem for fix(jest-matcher-utils): show byte order mark character in diff #13997 by simply using replaceAll.

@github-actions
Copy link

This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jul 12, 2023
@github-actions
Copy link

This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this Aug 11, 2023
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants