Skip to content

test(eslint-plugin): add missing test cases for rules #1402

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

Merged
merged 14 commits into from
Jan 5, 2020
Merged

test(eslint-plugin): add missing test cases for rules #1402

merged 14 commits into from
Jan 5, 2020

Conversation

armano2
Copy link
Collaborator

@armano2 armano2 commented Jan 3, 2020

This PR adds some edge cases for uncovered syntax that is actually validated by rules.

each commit represents changes to tests for one rule

  • there is few minor changes to code (redundant conditions)

i was unable to get coverage for all rules that i checked up to 100% (some of code paths can't be triggered)

affected tests for rules:

  • array-type
  • no-empty-interface
  • prefer-for-of
  • no-type-alias
  • triple-slash-reference
  • no-unnecessary-type-assertion
  • class-name-casing
  • no-misused-new
  • no-throw-literal
  • explicit-member-accessibility

@typescript-eslint

This comment has been minimized.

@armano2 armano2 added the tests anything to do with testing label Jan 3, 2020
@armano2 armano2 self-assigned this Jan 3, 2020
@armano2 armano2 marked this pull request as ready for review January 4, 2020 04:38
@armano2 armano2 added the package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin label Jan 5, 2020
Copy link
Member

@bradzacher bradzacher 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 this

@codecov
Copy link

codecov bot commented Jan 5, 2020

Codecov Report

Merging #1402 into master will increase coverage by 0.37%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1402      +/-   ##
==========================================
+ Coverage   94.05%   94.43%   +0.37%     
==========================================
  Files         140      140              
  Lines        6037     6034       -3     
  Branches     1713     1712       -1     
==========================================
+ Hits         5678     5698      +20     
+ Misses        193      186       -7     
+ Partials      166      150      -16
Impacted Files Coverage Δ
...es/eslint-plugin/src/rules/no-array-constructor.ts 100% <ø> (ø) ⬆️
packages/eslint-plugin/src/rules/no-type-alias.ts 100% <ø> (+4.91%) ⬆️
...-plugin/src/rules/explicit-member-accessibility.ts 96.36% <ø> (+7.27%) ⬆️
packages/eslint-plugin/src/rules/no-misused-new.ts 100% <ø> (+8.69%) ⬆️
...kages/eslint-plugin/src/rules/class-name-casing.ts 100% <ø> (+12%) ⬆️
...-plugin/src/rules/no-unnecessary-type-assertion.ts 89.87% <100%> (+2.53%) ⬆️
...ages/eslint-plugin/src/rules/no-empty-interface.ts 100% <100%> (+13.33%) ⬆️
packages/eslint-plugin/src/rules/array-type.ts 95.23% <0%> (+1.9%) ⬆️
...ckages/eslint-plugin/src/rules/no-throw-literal.ts 95.55% <0%> (+2.22%) ⬆️
... and 6 more

Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

sorry, I didn't realise github only showed me the last commit when I opened the notification...
A few suggestions, otherwise LGTM

@armano2 armano2 requested a review from bradzacher January 5, 2020 22:09
Copy link
Member

@bradzacher bradzacher 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!

@bradzacher bradzacher merged commit 01caad2 into typescript-eslint:master Jan 5, 2020
@armano2 armano2 deleted the text-cases branch January 5, 2020 23:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin tests anything to do with testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants