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

fix(valid-describe): add check for empty arguments #94

Merged
merged 2 commits into from
Mar 13, 2018

Conversation

with-heart
Copy link
Contributor

This PR fixes #93.

@@ -11,6 +11,7 @@ const ruleTester = new RuleTester({

ruleTester.run('valid-describe', rule, {
valid: [
'describe()',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty describe isn't valid - could you make it be a linting error instead?

Copy link
Member

@SimenB SimenB Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a

if (node.arguments.length < 2) {
  context.report({
    message: '`describe` requires 2 arguments',
    loc: paramsLocation(node.arguments),
  });
  return;
}

or something similar

SimenB
SimenB previously requested changes Mar 1, 2018
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment

@SimenB SimenB dismissed their stale review March 13, 2018 19:50

handled it

@SimenB SimenB merged commit 80c9b33 into jest-community:master Mar 13, 2018
@SimenB
Copy link
Member

SimenB commented Mar 13, 2018

🎉 This PR is included in version 21.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mchandler-cng
Copy link

@SimenB Sorry about that, ended up rather busy. Thanks for following through!

@SimenB
Copy link
Member

SimenB commented Mar 15, 2018

No worries 🙂 Seemed like a pretty critical error to land, and your PR was basically there

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 this pull request may close these issues.

valid-describe throws an error with empty arguments
3 participants