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

Documentation still implies RuleTester will log failures with zero valid or invalid tests #4681

Closed
platinumazure opened this Issue Dec 12, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@platinumazure
Copy link
Member

commented Dec 12, 2015

This can be reproduced in master easily by writing empty rule tests.

var ruleTester = new RuleTester();
var rule = require("path/to/rule");

ruleTester.run("rule-name", rule, {
    valid: [
    ],

    invalid: [
    ]
});

Expected: Assertion error for lack of valid tests, assertion error for lack of invalid tests.
Actual: "0 passing"

@eslintbot

This comment has been minimized.

Copy link

commented Dec 12, 2015

@platinumazure Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@ilyavolodin

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

I noticed this too while debugging some rules. It must be a regression, since it was working at some point.

@nzakas

This comment has been minimized.

Copy link
Member

commented Dec 13, 2015

This was intentional. It used to error, but that meant you couldn't focus in on just one falling case to debug it, you'd always have to have one valid and one invalid. I don't see a great need for this type of check, especially as it makes it harder to debug.

@platinumazure

This comment has been minimized.

Copy link
Member Author

commented Dec 13, 2015

Understood. Shall we remove references to that behavior in the docs and/or
code comments? I could file a PR for that under this issue if you like.
On Dec 13, 2015 10:32 AM, "Nicholas C. Zakas" notifications@github.com
wrote:

This was intentional. It used to error, but that meant you couldn't focus
in on just one falling case to debug it, you'd always have to have one
valid and one invalid. I don't see a great need for this type of check,
especially as it makes it harder to debug.


Reply to this email directly or view it on GitHub
#4681 (comment).

@nzakas

This comment has been minimized.

Copy link
Member

commented Dec 13, 2015

Yeah, if there are still lingering references, we should definitely remove them.

@platinumazure

This comment has been minimized.

Copy link
Member Author

commented Dec 13, 2015

Okay. I'll change the issue title when I'm at a PC.
On Dec 13, 2015 10:43 AM, "Nicholas C. Zakas" notifications@github.com
wrote:

Yeah, if there are still lingering references, we should definitely remove
them.


Reply to this email directly or view it on GitHub
#4681 (comment).

@platinumazure platinumazure changed the title RuleTester does not log failure with zero valid or invalid tests (contrary to docs) Documentation still implies RuleTester will log failures with zero valid or invalid tests Dec 14, 2015

@alberto alberto closed this in eca218c Dec 17, 2015

gyandeeps added a commit that referenced this issue Dec 17, 2015

Merge pull request #4732 from eslint/issue4681
Docs: RuleTester doesn't require any tests (fixes #4681)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.