Skip to content

Add tests for ESLint rules #29

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

SaladFork
Copy link

@SaladFork SaladFork commented Oct 30, 2018

Resolves #6. Thanks for tagging with Hacktoberfest and having good documentation!

This PR adds tests for all the rules in the project except for no-filter-instead-of-find, which already had tests. It also adds a test framework and test commands for running said tests (I picked Jest but it's easy to swap to whatever runner you'd prefer).

As part of writing these tests, I believe I found two bugs. I commented out the failing case and added a FIXME in both relevant tests:

  • classbody-starts-with-newline throws an error for this code which the documentation suggests should pass:
export class SomeClass {
    /**
     * Some comment
     */
    constructor() {
        super()
    }
}
  • no-duplicated-chains passes this code but the documentation suggests it should throw an error:
function render() {
    return (<div className={this.props.className}>
        <p>{this.props.text}</p>
    </div>);
}

This PR also corrects a few minor mistakes in the documentation.

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.

1 participant