Skip to content

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

Merged
SimenB merged 2 commits intojest-community:masterfrom
with-heart:fix-valid-describe
Mar 13, 2018
Merged

fix(valid-describe): add check for empty arguments#94
SimenB merged 2 commits intojest-community:masterfrom
with-heart:fix-valid-describe

Conversation

@with-heart
Copy link
Copy Markdown
Contributor

This PR fixes #93.


ruleTester.run('valid-describe', rule, {
valid: [
'describe()',
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

@SimenB
Copy link
Copy Markdown
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