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

Allow eslint-plugin-jest to recognize more disabled tests #4533

Merged
merged 1 commit into from
Sep 25, 2017
Merged

Allow eslint-plugin-jest to recognize more disabled tests #4533

merged 1 commit into from
Sep 25, 2017

Conversation

borilla
Copy link
Contributor

@borilla borilla commented Sep 25, 2017

Summary

This change affects the jest/no-disabled-tests rule of the Jest eslint plugin

This update allows the rule to recognize more disabled/skipped/pending tests, in line with information for Pending Specs in Jasmine

The existing rule already recognizes:

  • tests that append ".skip" (e.g. it.skip(...))
  • tests that prepend "x" (e.g. xit(...))

This change adds:

  • tests that don't contain a function body (e.g. it('foo')")
  • tests that contain a call to "pending()" (e.g. it('foo', () => { pending(); }))

Test plan

Additional test cases for the rule changes have been added to __tests__/no_disabled_tests.test.js

[This file was renamed from __tests__/no_skipped_tests.test.js to better match both the rule-name and the source file name it is testing]

@codecov-io
Copy link

codecov-io commented Sep 25, 2017

Codecov Report

Merging #4533 into master will increase coverage by 0.12%.
The diff coverage is 97.22%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4533      +/-   ##
=========================================
+ Coverage   55.98%   56.1%   +0.12%     
=========================================
  Files         185     185              
  Lines        6236    6254      +18     
  Branches        3       3              
=========================================
+ Hits         3491    3509      +18     
  Misses       2744    2744              
  Partials        1       1
Impacted Files Coverage Δ
packages/eslint-plugin-jest/src/index.js 100% <ø> (ø) ⬆️
.../eslint-plugin-jest/src/rules/no_disabled_tests.js 97.22% <97.22%> (+2.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44fbb6f...ceffc31. Read the comment docs.

@cpojer
Copy link
Member

cpojer commented Sep 25, 2017

@SimenB mind reviewing this one?

@SimenB
Copy link
Member

SimenB commented Sep 25, 2017

@borilla Could you rename the file/rule in a separate commit to make reviewing easier? 🙂 First glance looks good, but according to github everything changed

@borilla
Copy link
Contributor Author

borilla commented Sep 25, 2017

I've renamed the file back to the original so it's easier to see the diffs

Already recognizes:
* tests that append `skip` (e.g. `it.skip(...)`)
* tests that prepend `x` (e.g. `xit(...)`)

This change adds:
* tests that don't contain a function body
* tests that contain a call to `pending()`

https://jasmine.github.io/2.0/introduction.html#section-Pending_Specs
@SimenB
Copy link
Member

SimenB commented Sep 25, 2017

Great, thank you! Makes reading the new test cases way easier 🙂

The change LGTM. 👍 Feel free to rename the file back

@@ -37,6 +37,7 @@ module.exports = {
it: false,
jasmine: false,
jest: false,
pending: false,
Copy link
Member

Choose a reason for hiding this comment

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

I honestly didn't realize we exposed this global…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to admit I wasn't even aware of it myself until I checked out the docs for Jasmine

@cpojer
Copy link
Member

cpojer commented Sep 25, 2017

Thanks for doing this!

@cpojer cpojer merged commit f67476e into jestjs:master Sep 25, 2017
tabrindle pushed a commit to tabrindle/jest that referenced this pull request Oct 2, 2017
Already recognizes:
* tests that append `skip` (e.g. `it.skip(...)`)
* tests that prepend `x` (e.g. `xit(...)`)

This change adds:
* tests that don't contain a function body
* tests that contain a call to `pending()`

https://jasmine.github.io/2.0/introduction.html#section-Pending_Specs
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants