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

it.only() or describe.only() should fail lint #9

Closed
styfle opened this issue Apr 4, 2022 · 7 comments
Closed

it.only() or describe.only() should fail lint #9

styfle opened this issue Apr 4, 2022 · 7 comments
Labels

Comments

@styfle
Copy link
Member

styfle commented Apr 4, 2022

Sometimes developers will use it.only() or describe.only() to run a single jest test locally but accidentally commit it to a PR and thus skip all tests except the one they're working on.

We should probably disable it.skip() as well for the same reason.

@styfle
Copy link
Member Author

styfle commented Apr 4, 2022

Here's an example of how to achieve this vercel/vercel#4229

@adrianbw
Copy link

adrianbw commented Apr 4, 2022

Yes, 100%.

@codybrouwers
Copy link
Member

Good idea!

@ernestd
Copy link

ernestd commented Apr 4, 2022

+1 for .skip too

@mrmckeb
Copy link
Contributor

mrmckeb commented Apr 5, 2022

Thanks for raising this @styfle! Can I confirm that this doesn't work with this style guide today?

We extend plugin:jest/recommended, which enables:
https://github.com/jest-community/eslint-plugin-jest/blob/HEAD/docs/rules/no-disabled-tests.md

There's an example showing how to set up the jest config here:
https://github.com/vercel/style-guide#scoped-configuration-with-overrides

@mrmckeb mrmckeb added the eslint label Apr 5, 2022
@styfle
Copy link
Member Author

styfle commented Apr 5, 2022

@mrmckeb I created this issue because I was reviewing a PR and it used describe.only() yet CI was passing.

@mrmckeb
Copy link
Contributor

mrmckeb commented Apr 6, 2022

Ah, that repo didn't have the jest config. I've now added it.

CC @dglsparsons who was leading the charge on that part of our internal rollout.

@mrmckeb mrmckeb closed this as completed Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants