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

Improve error message when missing errors field in rule-tester #5369

Closed
jfmengels opened this issue Feb 22, 2016 · 3 comments
Closed

Improve error message when missing errors field in rule-tester #5369

jfmengels opened this issue Feb 22, 2016 · 3 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features infrastructure Relates to the tools used in the ESLint development process

Comments

@jfmengels
Copy link
Contributor

In version 1.10.3 (and probably earlier), when I forget to specify the errors field in an invalid case when using rule-tester, I get the error 'Cannot read property 'length' of undefined'. I think it would be nice to give a more explicit error message.

ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
    valid: [
        "Eval(foo)"
    ],
    invalid: [
        { code: "eval(foo)" } // Missing `errors` field
    ]
});

I'm willing to submit a PR (actually already prepared one, to update when accepted).

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Feb 22, 2016
@gyandeeps
Copy link
Member

Yes, It happened to me also this morning. I think it would be good to have an appropriate message.

@gyandeeps gyandeeps added enhancement This change enhances an existing feature of ESLint infrastructure Relates to the tools used in the ESLint development process core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion bug ESLint is working incorrectly and removed triage An ESLint team member will look at this issue soon enhancement This change enhances an existing feature of ESLint labels Feb 22, 2016
@alberto
Copy link
Member

alberto commented Feb 22, 2016

+1

@ilyavolodin ilyavolodin added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Feb 22, 2016
@ilyavolodin
Copy link
Member

Sounds good to me! Accepted

jfmengels added a commit to jfmengels/eslint that referenced this issue Feb 22, 2016
jfmengels added a commit to jfmengels/eslint that referenced this issue Feb 22, 2016
jfmengels added a commit to jfmengels/eslint that referenced this issue Feb 22, 2016
nzakas added a commit that referenced this issue Feb 24, 2016
Update: Improve error message for rule-tester (fixes #5369)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features infrastructure Relates to the tools used in the ESLint development process
Projects
None yet
Development

No branches or pull requests

5 participants