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: add test case for no-func-assign (refs #13705) #13783

Merged
merged 2 commits into from Oct 22, 2020

Conversation

@snitin315
Copy link
Contributor

@snitin315 snitin315 commented Oct 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: - test

What changes did you make? (Give an overview)

Refers #13705

Added test cases for no-func-assign.

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

@eslint eslint bot added the triage label Oct 22, 2020
@mdjermanovic mdjermanovic added accepted chore and removed triage labels Oct 22, 2020
@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Oct 22, 2020

Thanks for the PR!

For the context, no-func-assign checks named function expressions from the start, although it seems that it was meant to check function declarations only. There were no test cases and no documented examples with named function expressions.

Either way, it does make sense to check named function expressions in this rule. This PR adds a test to confirm the actual behavior and make sure it won't change.

The documentation update is in #13777.

tests/lib/rules/no-func-assign.js Outdated Show resolved Hide resolved
@snitin315 snitin315 requested a review from mdjermanovic Oct 22, 2020
@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Oct 22, 2020

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit 17cc0dd into eslint:master Oct 22, 2020
12 checks passed
12 checks passed
Verify Files
Details
Test (ubuntu-latest, 14.x)
Details
Test (ubuntu-latest, 13.x)
Details
Test (ubuntu-latest, 12.x)
Details
Test (ubuntu-latest, 10.x)
Details
Test (ubuntu-latest, 10.12.0)
Details
Test (windows-latest, 12.x)
Details
Test (macOS-latest, 12.x)
Details
Browser Test
Details
commit-message PR title follows commit message guidelines
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
@snitin315 snitin315 deleted the snitin315:tests/no-func-assign branch Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.