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-describe with expect #342

Closed
benmonro opened this issue Jul 22, 2019 · 2 comments
Closed

valid-describe with expect #342

benmonro opened this issue Jul 22, 2019 · 2 comments
Labels

Comments

@benmonro
Copy link
Contributor

curious if we can/should modify valid-describe to report an error if it finds an expect in a describe.

for example:

describe("some stuff", () => {
  expect("blah").toBe("foo");
}

jest won't report that as a test so wondering if it should be reported as an error. if it should be reported should we put that in valid-describe or in a standalone rule called no-standalone-expect

thoughts?

@SimenB
Copy link
Member

SimenB commented Jul 23, 2019

I like this idea. A separate rule throwing if an expect is outside of a test case might make sense? Potentially with a flag that just disallows it in hooks and describes (so people can use helper functions for shared assertions), maybe? I don't think it needs to be coupled to valid-describe. Could stick it in valid-expect, but I think that's already getting super advanced and a separate rule makes more sense. Maybe not, though 🙂

@SimenB
Copy link
Member

SimenB commented Jul 26, 2019

🎉 This issue has been resolved in version 22.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

2 participants