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

RuleTester swallows parsing errors when fixing #4779

Closed
nzakas opened this Issue Dec 21, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@nzakas
Copy link
Member

nzakas commented Dec 21, 2015

I came across a problem with RuleTester where it swallows parsing errors when there's output specified in an invalid test case. Example:

{
    code: "var foo = `bar`;",
    output: "var foo = 'bar';",
    options: ["single"],
    errors: [{ message: "Strings must use singlequote.", type: "Literal"}]
},

This will fail to parse because ecmaVersion isn't set to 6, however, RuleTester just outputs "Output does not match." It should output the parsing error (I spent about an hour tracking this down).

@nzakas nzakas self-assigned this Dec 21, 2015

@nzakas nzakas added this to the v2.0.0 milestone Dec 21, 2015

@nzakas nzakas closed this in 71d83a2 Dec 22, 2015

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

Merge pull request #4780 from eslint/issue4779
Fix: RuleTester to show parsing errors (fixes #4779)

@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.