Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

valid-describe: warn if first argument is a function #61

Closed
macklinu opened this issue Feb 9, 2018 · 8 comments
Closed

valid-describe: warn if first argument is a function #61

macklinu opened this issue Feb 9, 2018 · 8 comments

Comments

@macklinu
Copy link
Collaborator

macklinu commented Feb 9, 2018

From #57 (comment)

Report in the valid-describe rule for the following case:

describe(() => {})
@SimenB
Copy link
Member

SimenB commented Feb 9, 2018

Also see jestjs/jest#5493

@macklinu
Copy link
Collaborator Author

macklinu commented Feb 9, 2018

I'll open a PR for this.

@brianlmacdonald
Copy link
Contributor

Can I call dibs on this?

@macklinu
Copy link
Collaborator Author

macklinu commented Feb 9, 2018

@brianlmacdonald go for it - thanks!

I noticed that the valid-describe rule falsely reports this as valid:

when I believe that describe() always requires two parameters (name: string, fn: Function), which is something I missed in #57.

If you're feeling up for correcting that test case in your PR, that would be awesome too. 😄

@brianlmacdonald
Copy link
Contributor

Hey @macklinu, I added the appropriate warnings and tests-- the messages are as follows [message: 'First argument must be name', 'message: 'Describe requires name and callback arguments'']. Happy to change them to any house style verabe if you'd rather before I put in the PR.

Also, I'm not familiar with husky or commitmsg-- can you tell me what these warnings are referring too so I can fix them?
✖ message may not be empty [subject-empty]
✖ type may not be empty [type-empty]

Hope you're having a good Saturday!

@SimenB
Copy link
Member

SimenB commented Feb 10, 2018

The commit message must follow the form of "feat: some added feature". We use these semantic commits to publish from CI.

See http://karma-runner.github.io/2.0/dev/git-commit-msg.html

@brianlmacdonald
Copy link
Contributor

Ok, thanks!

@macklinu
Copy link
Collaborator Author

Resolved in #65. Closing.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants