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.3.2
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.3.3
Choose a head ref
  • 6 commits
  • 11 files changed
  • 3 contributors

Commits on Mar 22, 2021

  1. Copy the full SHA
    4cbd6de View commit details

Commits on Mar 24, 2021

  1. Copy the full SHA
    1b9d57d View commit details

Commits on Mar 29, 2021

  1. Copy the full SHA
    5945772 View commit details

Commits on Apr 2, 2021

  1. Copy the full SHA
    243cb4f View commit details
  2. Copy the full SHA
    f758243 View commit details
  3. chore(release): 24.3.3 [skip ci]

    ## [24.3.3](v24.3.2...v24.3.3) (2021-04-02)
    
    ### Bug Fixes
    
    * **no-duplicate-hooks:** support `describe.each` ([#797](#797)) ([243cb4f](243cb4f)), closes [#642](#642)
    * **prefer-expect-assertions:** support `.each` ([#798](#798)) ([f758243](f758243)), closes [#676](#676)
    semantic-release-bot committed Apr 2, 2021
    Copy the full SHA
    7a1ab7a View commit details
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -18,6 +18,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Danger
uses: danger/danger-js@10.6.3
uses: danger/danger-js@10.6.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [24.3.3](https://github.com/jest-community/eslint-plugin-jest/compare/v24.3.2...v24.3.3) (2021-04-02)


### Bug Fixes

* **no-duplicate-hooks:** support `describe.each` ([#797](https://github.com/jest-community/eslint-plugin-jest/issues/797)) ([243cb4f](https://github.com/jest-community/eslint-plugin-jest/commit/243cb4f970e40aa195a3bffa0528dbdbfef7c4f5)), closes [#642](https://github.com/jest-community/eslint-plugin-jest/issues/642)
* **prefer-expect-assertions:** support `.each` ([#798](https://github.com/jest-community/eslint-plugin-jest/issues/798)) ([f758243](https://github.com/jest-community/eslint-plugin-jest/commit/f75824359f2242f53997c59c238d83a59badeea3)), closes [#676](https://github.com/jest-community/eslint-plugin-jest/issues/676)

## [24.3.2](https://github.com/jest-community/eslint-plugin-jest/compare/v24.3.1...v24.3.2) (2021-03-16)


4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-jest",
"version": "24.3.2",
"version": "24.3.3",
"description": "Eslint rules for Jest",
"keywords": [
"eslint",
@@ -108,7 +108,7 @@
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.0",
"husky": "^5.1.3",
"husky": "^6.0.0",
"is-ci": "^3.0.0",
"jest": "^26.0.1",
"jest-runner-eslint": "^0.10.0",
1 change: 1 addition & 0 deletions src/rules/__tests__/lowercase-name.test.ts
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ const ruleTester = new TSESLint.RuleTester({
ruleTester.run('lowercase-name', rule, {
valid: [
'it.each()',
'it.each()(1)',
'randomFunction()',
'foo.bar()',
'it()',
167 changes: 167 additions & 0 deletions src/rules/__tests__/no-duplicate-hooks.test.ts
Original file line number Diff line number Diff line change
@@ -288,3 +288,170 @@ ruleTester.run('nested describe blocks', rule, {
},
],
});

ruleTester.run('describe.each blocks', rule, {
valid: [
dedent`
describe.each(['hello'])('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
`,
dedent`
describe('something', () => {
describe.each(['hello'])('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
describe.each(['world'])('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
});
`,
dedent`
describe.each\`\`('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
`,
dedent`
describe('something', () => {
describe.each\`\`('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
describe.each\`\`('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
});
`,
],
invalid: [
{
code: dedent`
describe.each(['hello'])('%s', () => {
beforeEach(() => {});
beforeEach(() => {});
it('is not fine', () => {});
});
`,
errors: [
{
messageId: 'noDuplicateHook',
data: { hook: 'beforeEach' },
column: 3,
line: 3,
},
],
},
{
code: dedent`
describe('something', () => {
describe.each(['hello'])('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
describe.each(['world'])('%s', () => {
beforeEach(() => {});
beforeEach(() => {});
it('is not fine', () => {});
});
});
`,
errors: [
{
messageId: 'noDuplicateHook',
data: { hook: 'beforeEach' },
column: 5,
line: 10,
},
],
},
{
code: dedent`
describe('something', () => {
describe.each(['hello'])('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
describe.each(['world'])('%s', () => {
describe('some more', () => {
beforeEach(() => {});
beforeEach(() => {});
it('is not fine', () => {});
});
});
});
`,
errors: [
{
messageId: 'noDuplicateHook',
data: { hook: 'beforeEach' },
column: 7,
line: 11,
},
],
},
{
code: dedent`
describe.each\`\`('%s', () => {
beforeEach(() => {});
beforeEach(() => {});
it('is fine', () => {});
});
`,
errors: [
{
messageId: 'noDuplicateHook',
data: { hook: 'beforeEach' },
column: 3,
line: 3,
},
],
},
{
code: dedent`
describe('something', () => {
describe.each\`\`('%s', () => {
beforeEach(() => {});
it('is fine', () => {});
});
describe.each\`\`('%s', () => {
beforeEach(() => {});
beforeEach(() => {});
it('is not fine', () => {});
});
});
`,
errors: [
{
messageId: 'noDuplicateHook',
data: { hook: 'beforeEach' },
column: 5,
line: 10,
},
],
},
],
});
Loading