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

Fix ESLint Jest reporting entire body of the test function rather than the identifier #67222

Conversation

manzoorwanijk
Copy link
Contributor

Fixes #67185

What?

In the previous versions, eslint-plugin-jest reported the entire body as erroneous for expect-expect rule, which adds a lot of noise as mentioned in the linked issue.

Why?

The latest version removes that noise.

How?

This PR updates eslint-plugin-jest to the latest version

Testing Instructions

  • Open a test file in VS Code
  • Remove the assertion call
  • Confirm that the expect-expect warning is shown on the test function identifier (test, it), rather than the whole body.

Testing Instructions for Keyboard

Screenshots or screencast

Before After
Screenshot 2024-11-22 at 1 09 41 PM Screenshot 2024-11-22 at 1 08 51 PM

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: manzoorwanijk <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: talldan <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@talldan talldan added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. Developer Experience Ideas about improving block and theme developer experience labels Nov 22, 2024
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this, I'm glad the rule didn't have to be disabled

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thank you, @manzoorwanijk!

@Mamaduka Mamaduka merged commit b58cce6 into WordPress:trunk Nov 22, 2024
70 of 74 checks passed
@manzoorwanijk manzoorwanijk deleted the fix/eslint-jest-reporting-the-entire-test-as-erroneous branch November 22, 2024 08:31
@github-actions github-actions bot added this to the Gutenberg 19.8 milestone Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Test has no assertions" lint rule is very annoying when writing tests
3 participants