Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jest-community/eslint-plugin-jest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v24.1.6
Choose a base ref
...
head repository: jest-community/eslint-plugin-jest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v24.1.7
Choose a head ref
  • 5 commits
  • 7 files changed
  • 3 contributors

Commits on Mar 6, 2021

  1. Copy the full SHA
    27a7245 View commit details
  2. Copy the full SHA
    c916902 View commit details
  3. Copy the full SHA
    92a8826 View commit details
  4. Copy the full SHA
    6a32e87 View commit details
  5. chore(release): 24.1.7 [skip ci]

    ## [24.1.7](v24.1.6...v24.1.7) (2021-03-06)
    
    ### Bug Fixes
    
    * **no-disabled-tests:** adjust selector to match only test functions ([#777](#777)) ([c916902](c916902))
    * **no-disabled-tests:** support `describe.skip.each` & `xdescribe.each` ([#778](#778)) ([6a32e87](6a32e87))
    semantic-release-bot committed Mar 6, 2021
    Copy the full SHA
    e3f83a7 View commit details
Showing with 40 additions and 7 deletions.
  1. +1 −3 .github/workflows/nodejs.yml
  2. +8 −0 CHANGELOG.md
  3. +1 −1 README.md
  4. +4 −1 package.json
  5. +10 −0 src/rules/__tests__/no-disabled-tests.test.ts
  6. +12 −0 src/rules/__tests__/no-test-prefixes.test.ts
  7. +4 −2 src/rules/no-disabled-tests.ts
4 changes: 1 addition & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -3,12 +3,10 @@ name: Unit tests & Release
on:
push:
branches:
- master
- main
- next
pull_request:
branches:
- master
- main
- next

@@ -153,7 +151,7 @@ jobs:
release:
if:
# prettier-ignore
${{ github.event_name == 'push' && github.event.ref == 'refs/heads/master' }}
${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
name: Release new version
needs: [test-node, test-os]
runs-on: ubuntu-latest
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [24.1.7](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.6...v24.1.7) (2021-03-06)


### Bug Fixes

* **no-disabled-tests:** adjust selector to match only test functions ([#777](https://github.com/jest-community/eslint-plugin-jest/issues/777)) ([c916902](https://github.com/jest-community/eslint-plugin-jest/commit/c9169022c7e4b9c7bd5f09060152f7136ee18521))
* **no-disabled-tests:** support `describe.skip.each` & `xdescribe.each` ([#778](https://github.com/jest-community/eslint-plugin-jest/issues/778)) ([6a32e87](https://github.com/jest-community/eslint-plugin-jest/commit/6a32e870c016474687e238944933a96bfe1ca01b))

## [24.1.6](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.5...v24.1.6) (2021-03-06)


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
<p>ESLint plugin for Jest</p>
</div>

[![Actions Status](https://github.com/jest-community/eslint-plugin-jest/workflows/Unit%20tests/badge.svg?branch=master)](https://github.com/jest-community/eslint-plugin-jest/actions)
[![Actions Status](https://github.com/jest-community/eslint-plugin-jest/workflows/Unit%20tests/badge.svg?branch=main)](https://github.com/jest-community/eslint-plugin-jest/actions)

## Installation

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-jest",
"version": "24.1.6",
"version": "24.1.7",
"description": "Eslint rules for Jest",
"keywords": [
"eslint",
@@ -128,6 +128,9 @@
"node": ">=10"
},
"release": {
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
10 changes: 10 additions & 0 deletions src/rules/__tests__/no-disabled-tests.test.ts
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@ ruleTester.run('no-disabled-tests', rule, {
'(a || b).f()',
'itHappensToStartWithIt()',
'testSomething()',
'xitSomethingElse()',
'xitiViewMap()',
dedent`
import { pending } from "actions"
@@ -65,6 +67,14 @@ ruleTester.run('no-disabled-tests', rule, {
code: 'describe.skip("foo", function () {})',
errors: [{ messageId: 'skippedTestSuite', column: 1, line: 1 }],
},
{
code: 'describe.skip.each([1, 2, 3])("%s", (a, b) => {});',
errors: [{ messageId: 'skippedTestSuite', column: 1, line: 1 }],
},
{
code: 'xdescribe.each([1, 2, 3])("%s", (a, b) => {});',
errors: [{ messageId: 'skippedTestSuite', column: 1, line: 1 }],
},
{
code: 'describe[`skip`]("foo", function () {})',
errors: [{ messageId: 'skippedTestSuite', column: 1, line: 1 }],
12 changes: 12 additions & 0 deletions src/rules/__tests__/no-test-prefixes.test.ts
Original file line number Diff line number Diff line change
@@ -46,6 +46,18 @@ ruleTester.run('no-test-prefixes', rule, {
},
],
},
{
code: 'xdescribe.each([])("foo", function () {})',
output: 'describe.skip.each([])("foo", function () {})',
errors: [
{
messageId: 'usePreferredName',
data: { preferredNodeName: 'describe.skip.each' },
column: 1,
line: 1,
},
],
},
{
code: 'fit("foo", function () {})',
output: 'it.only("foo", function () {})',
6 changes: 4 additions & 2 deletions src/rules/no-disabled-tests.ts
Original file line number Diff line number Diff line change
@@ -45,6 +45,8 @@ export default createRule({
}

switch (functionName) {
case 'describe.skip.each':
case 'xdescribe.each':
case 'describe.skip':
context.report({ messageId: 'skippedTestSuite', node });
break;
@@ -77,13 +79,13 @@ export default createRule({
'CallExpression[callee.name="xdescribe"]'(node) {
context.report({ messageId: 'disabledSuite', node });
},
'CallExpression[callee.name=/^xit|xtest$/]'(node) {
'CallExpression[callee.name=/^(xit|xtest)$/]'(node) {
context.report({ messageId: 'disabledTest', node });
},
'CallExpression[callee.name="describe"]:exit'() {
suiteDepth--;
},
'CallExpression[callee.name=/^it|test$/]:exit'() {
'CallExpression[callee.name=/^(it|test)$/]:exit'() {
testDepth--;
},
};