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

Chore: "Error type should be" assertion in rule-tester (fixes 6106) #7550

Merged
merged 1 commit into from
Nov 8, 2016
Merged

Conversation

Fransz
Copy link
Contributor

@Fransz Fransz commented Nov 6, 2016

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X ] Other, please explain: Change in rule-tester.

issue 6106

What changes did you make? (Give an overview)
Removed the overwriting message in the assert.equal statement.

Is there anything you'd like reviewers to focus on?

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@Fransz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kaicataldo, @gyandeeps and @nzakas to be potential reviewers.

Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I have a suggestion for improving the error message.

@@ -446,7 +446,7 @@ RuleTester.prototype = {
}

if (item.errors[i].type) {
assert.equal(messages[i].nodeType, item.errors[i].type, `Error type should be ${item.errors[i].type}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that removing this message is the right way to go about this change; I think "Error type should be CallExpression" provides useful context about the issue, whereas "CallExpression != SomethingElse" is sort of confusing.

Instead, maybe the message should say something along the lines of: "Expected an error type of CallExpression but found Indentifier". That keeps the helpful "Error type should be" context, while also providing the additional information in #6106.

Copy link
Contributor Author

@Fransz Fransz Nov 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've changed the message as requested.

@not-an-aardvark not-an-aardvark added enhancement This change enhances an existing feature of ESLint cli Relates to ESLint's command-line interface accepted There is consensus among the team that this change meets the criteria for inclusion labels Nov 6, 2016
@eslintbot
Copy link

LGTM

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just waiting for @not-an-aardvark to re-review.

Also, this should be an "Update:" because it's making a change that's not related to a bug.

Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@not-an-aardvark not-an-aardvark merged commit 1766524 into eslint:master Nov 8, 2016
@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 cli Relates to ESLint's command-line interface enhancement This change enhances an existing feature of ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants