WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.53k stars 4.21k forks source link

"Test has no assertions" lint rule is very annoying when writing tests #67185

Closed talldan closed 12 minutes ago

talldan commented 1 day ago

The "Test has no assertions" lint rule makes it very hard to see what you're doing when you're in the process of writing tests:

I haven't gotten to the point where I want to add an assertion yet. There are squigly yellow lines everywhere! I should be able to add assertions in my own time.

This might depend on the IDE/plugins being used, but I think my setup is a pretty standard one.

I'd suggest disabling this unless it can be improved as it's a bad experience for contributors. For me, this discourages writing tests.

Mamaduka commented 23 hours ago

100%. This was super annoying when I was migrating tests to Playwright. Sure, you can start a simple test with assertion, but that's rarely the case in this project.

manzoorwanijk commented 1 hour ago

It was fixed in https://github.com/jest-community/eslint-plugin-jest/pull/1452.

I have created #67222 to update the package and fix the issue.