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: Move comment to make tests more organized #13707

Merged
merged 1 commit into from Sep 26, 2020

Conversation

magurotuna
Copy link
Contributor

@magurotuna magurotuna commented Sep 22, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an 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: Move a comment in the getter-return test, so that the orders of tests will make sense.

What changes did you make? (Give an overview)

Currently, a part of the getter-return tests look like:

{ code: "Object.defineProperties(foo, { bar: { get: function () {}} });", options, errors: [{ messageId: "expected" }] },
{ code: "Object.defineProperties(foo, { bar: { get: function (){if(bar) {return true;}}}});", options, errors: [{ messageId: "expectedAlways" }] },
{ code: "Object.defineProperties(foo, { bar: { get: function () {~function () { return true; }()}} });", options, errors: [{ messageId: "expected" }] },
// option: {allowImplicit: true}
{ code: "Object.defineProperty(foo, \"bar\", { get: function (){}});", options, errors: [{ messageId: "expected" }] },

Seeing this, it is quite natural that we think {allowImplicit: true} is applied only to line 226. But in fact, {allowImplicit: true} is also applied to line 221-223 - it's really confusing.

So I have moved this comment up, which indicates that this comment is applied to these 4 test cases.

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

no

@jsf-clabot
Copy link

@jsf-clabot jsf-clabot commented Sep 22, 2020

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage label Sep 22, 2020
@mdjermanovic mdjermanovic added chore evaluating rule accepted and removed triage evaluating labels Sep 24, 2020
@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Sep 24, 2020

Thanks for the PR, nice catch!

Copy link
Member

@mdjermanovic mdjermanovic left a comment

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit b7b12ba into eslint:master Sep 26, 2020
12 checks passed
@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Sep 26, 2020

Thanks for contributing!

@magurotuna magurotuna deleted the organize-getter-return-test branch Sep 27, 2020
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 26, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age label Mar 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted archived due to age chore rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants