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
jest/valid-describe false positive for descibe.each variant #334
Comments
Also have the same error, it's valid: https://jestjs.io/docs/en/api#describeeachtable-name-fn-timeout |
I suspect I know what's causing this, but I can't reproduce the error - I managed to have it show up once in my IDE, but it didn't have a stacktrace and went away after a second. I hate to be a pain, but if you could provide a small repo that reproduced the error, or even a stacktrace, that'd be a great help! |
Pasting in the snippet in the OP fails for me. Diff with failing test: diff --git i/src/rules/__tests__/valid-describe.test.ts w/src/rules/__tests__/valid-describe.test.ts
index adfbad5..5f63b49 100644
--- i/src/rules/__tests__/valid-describe.test.ts
+++ w/src/rules/__tests__/valid-describe.test.ts
@@ -37,6 +37,11 @@ ruleTester.run('valid-describe', rule, {
test('bar', () => {})
)
`,
+ `
+ describe.each([...data])('Something', data => {
+ // ...
+ })
+ `,
],
invalid: [
{ EDIT: And yes, reverting #317 "fixes" it. Fixes in that |
eeekkkk but totally what I expected - I'll try and wipe up a fix asap. |
The real fix is to handle |
One step ahead of you ;) I'm going to make a quick fix to ignore The rule readme actually excludes
|
Sorry my quick fix ended up not being so quick as I got distracted finishing off the conversion for |
🎉 This issue has been resolved in version 22.13.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Wow! Thanks for the quick fix! <3 |
For some reason, this now triggers on completely unrelated code: import { hasOwnProperty } from './has-own-property'
export function size(obj: object): number {
let size = 0
for (let key in obj) {
if (hasOwnProperty(obj, key)) {
size++
}
}
return size
}
|
what in the world... failing test: diff --git i/src/rules/__tests__/valid-describe.test.ts w/src/rules/__tests__/valid-describe.test.ts
index b5e2cd7..66e299e 100644
--- i/src/rules/__tests__/valid-describe.test.ts
+++ w/src/rules/__tests__/valid-describe.test.ts
@@ -38,6 +38,10 @@ ruleTester.run('valid-describe', rule, {
test('bar', () => {})
)
`,
+ `
+ if (hasOwnProperty(obj, key)) {
+ }
+ `,
],
invalid: [
{ |
Oh, it's the |
I'm trying to push a fix, but GH is having issues... https://www.githubstatus.com/ |
🎉 This issue has been resolved in version 22.13.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks again for the quick fixes ❤️ |
The rule
jest/valid-describe
errors for thedescribe.each
variant:leads to:
The text was updated successfully, but these errors were encountered: