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 should allow functions #247

Closed
JoshuaKGoldberg opened this issue Sep 6, 2023 · 1 comment · Fixed by #453
Closed

valid-title should allow functions #247

JoshuaKGoldberg opened this issue Sep 6, 2023 · 1 comment · Fixed by #453

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Sep 6, 2023

As of vitest-dev/vitest#3493 -> vitest-dev/vitest#3497, Vitest describes & similar can take in function names. I think the valid-title rule should by default no longer complain if a function name is provided.

Before:

import { describe } from "vitest"

function isBodyWithReplies() { /* ... */ }

describe(isBodyWithReplies, () => {
	//   ~~~~~~~~~~~~~~~~~~ Test title must be a string
	// ...
})

After:

import { describe } from "vitest"

function isBodyWithReplies() { /* ... */ }

describe(isBodyWithReplies, () => {
	//   OK
	// ...
});

describe(1234567890, () => {
	//   ~~~~~~~~~~ Test title must be a function or string
	// ...
});

I'd be happy to send a PR for this! ❤️

@veritem
Copy link
Member

veritem commented Sep 10, 2023

a PR would be much appreciated as always.

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

Successfully merging a pull request may close this issue.

2 participants