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

Fix: actual messageId and expected messageId are switched in rule tester #11928

Merged
merged 1 commit into from Jul 4, 2019
Merged

Fix: actual messageId and expected messageId are switched in rule tester #11928

merged 1 commit into from Jul 4, 2019

Conversation

mdjermanovic
Copy link
Member

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

[X] Other, please explain: Small fix in rule tester

ESLint Version: master
  
What did you do? Please include the actual source code causing the issue.

Add the following test example to tests/lib/rules/dot-location.js:

{
      code: "obj\n.property",
      output: "obj.\nproperty",
      options: ["object"],
      errors: [{ messageId: "expectedDotBeforeProperty" }]
}

What did you expect to happen?

AssertionError [ERR_ASSERTION]: messageId 'expectedDotAfterObject' does not match expected messageId 'expectedDotBeforeProperty'.
+ expected - actual

-expectedDotAfterObject
+expectedDotBeforeProperty

What actually happened? Please include the actual, raw output from ESLint.

AssertionError [ERR_ASSERTION]: messageId 'expectedDotAfterObject' does not match expected messageId 'expectedDotBeforeProperty'.
+ expected - actual

-expectedDotBeforeProperty
+expectedDotAfterObject

What changes did you make? (Give an overview)

Switched args in rule tester.

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

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jul 1, 2019
Copy link
Member

@platinumazure platinumazure 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! Nice catch!

@platinumazure platinumazure added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features and removed triage An ESLint team member will look at this issue soon labels Jul 1, 2019
Copy link
Member

@kaicataldo kaicataldo 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 for contributing!

@platinumazure
Copy link
Member

Small nit: I think this could be called a bugfix rather than a chore since RuleTester is a public API/tool (albeit used by rule developers), but I don't feel strongly about changing the commit message. Maybe we could change the commit message on merge.

@mdjermanovic
Copy link
Member Author

Small nit: I think this could be called a bugfix rather than a chore since RuleTester is a public API/tool (albeit used by rule developers), but I don't feel strongly about changing the commit message. Maybe we could change the commit message on merge.

Sorry, my mistake, I read the guide about commit messages (Chore - ... anything that isn’t user-facing) and wrongly interpreted 'user' (like, someone who needs only 'User guide' menu from the website).

I'll change the message and PR title.

@mdjermanovic mdjermanovic changed the title Chore: Fix switched actual and expected messageIds in rule tester Fix: actual messageId and expected messageId are switched in rule tester Jul 1, 2019
@kaicataldo
Copy link
Member

No need to apologize, we get it wrong sometimes too :)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants