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

valid-title: false positives when using it.each #458

Closed
swissspidy opened this issue Oct 28, 2019 · 5 comments · Fixed by #460
Closed

valid-title: false positives when using it.each #458

swissspidy opened this issue Oct 28, 2019 · 5 comments · Fixed by #460

Comments

@swissspidy
Copy link

With version 23, if I'm using something like this:

describe( 'myFunction', () => {
	it.each( [
		[ 123, true ],
		[ 456, true ],
		[ 789, false ],
		[ 0, false ],
	] )( 'should do something',
		( number, myBool ) => {
			expect( muFunction( number ) ).toBe( myBool );
		},
	);
} );

The jest/valid-title complains about the array not being a valid title.

I see that there have been a few changes to valid-title in the last releases. So perhaps an issue like #334 is now appearing again, or at least this one here is very similar.

src/rules/__tests__/valid-title.test.ts doesn't have any test cases for it.each (except a single one from #436). Adding some would be good I think.

@G-Rath
Copy link
Collaborator

G-Rath commented Oct 28, 2019

Hmm interesting - that's b/c of valid-describe; when porting it over, I forgot I added the describe-each bailout at the top 😂

I'll get a fix out shortly.

@swissspidy
Copy link
Author

Thanks @G-Rath, I appreciate your quick response!

@github-actions
Copy link

🎉 This issue has been resolved in version 23.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@misha-erm
Copy link

Hm, looks like it's still an issue in "eslint-plugin-jest": "24.1.2",

image

@G-Rath Could you please take a look?

@misha-erm
Copy link

Oops. I'm so sorry. I used a wrong syntax and eslint error is expected here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants