From e5561d6e70e81c6ca29bec664fc4530a244a92ce Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Mar 2021 20:56:01 +0100 Subject: [PATCH 1/3] chore(deps): update codecov/codecov-action action to v1.2.2 (#789) --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0251b18b9..5c3136e03 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -82,7 +82,7 @@ jobs: run: yarn test --coverage ${{ matrix.eslint-version >= 6 }} env: CI: true - - uses: codecov/codecov-action@v1.2.1 + - uses: codecov/codecov-action@v1.2.2 if: ${{ matrix.eslint-version >= 6 }} test-os: name: Test on ${{ matrix.os }} using Node.js LTS From ce26621a06169fb6728d2d015645d31401de523f Mon Sep 17 00:00:00 2001 From: Idan Attias Date: Wed, 10 Mar 2021 13:57:53 +0200 Subject: [PATCH 2/3] fix(no-identical-titles): support nested describes (#790) --- src/rules/__tests__/no-identical-title.test.ts | 9 +++++++++ src/rules/no-identical-title.ts | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/rules/__tests__/no-identical-title.test.ts b/src/rules/__tests__/no-identical-title.test.ts index 3b2ec2ff3..ee63925f6 100644 --- a/src/rules/__tests__/no-identical-title.test.ts +++ b/src/rules/__tests__/no-identical-title.test.ts @@ -125,6 +125,15 @@ ruleTester.run('no-identical-title', rule, { ${'a'} \`("$description", () => {}) `, + dedent` + describe("top level", () => { + describe.each\`\`("nested each", () => { + describe.each\`\`("nested nested each", () => {}) + }) + + describe("nested", () => {}) + }) + `, ], invalid: [ { diff --git a/src/rules/no-identical-title.ts b/src/rules/no-identical-title.ts index 6f1f69bf0..1c5f59efc 100644 --- a/src/rules/no-identical-title.ts +++ b/src/rules/no-identical-title.ts @@ -42,13 +42,14 @@ export default createRule({ CallExpression(node) { const currentLayer = contexts[contexts.length - 1]; + if (isDescribe(node)) { + contexts.push(newDescribeContext()); + } + if (node.callee.type === AST_NODE_TYPES.TaggedTemplateExpression) { return; } - if (isDescribe(node)) { - contexts.push(newDescribeContext()); - } const [argument] = node.arguments; if (!argument || !isStringNode(argument)) { From 712a56ef518e6d91746cbde0a9d42c8fe90a4b38 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 10 Mar 2021 12:04:52 +0000 Subject: [PATCH 3/3] chore(release): 24.2.1 [skip ci] ## [24.2.1](https://github.com/jest-community/eslint-plugin-jest/compare/v24.2.0...v24.2.1) (2021-03-10) ### Bug Fixes * **no-identical-titles:** support nested describes ([#790](https://github.com/jest-community/eslint-plugin-jest/issues/790)) ([ce26621](https://github.com/jest-community/eslint-plugin-jest/commit/ce26621a06169fb6728d2d015645d31401de523f)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f36ee59d..b2abdfb0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [24.2.1](https://github.com/jest-community/eslint-plugin-jest/compare/v24.2.0...v24.2.1) (2021-03-10) + + +### Bug Fixes + +* **no-identical-titles:** support nested describes ([#790](https://github.com/jest-community/eslint-plugin-jest/issues/790)) ([ce26621](https://github.com/jest-community/eslint-plugin-jest/commit/ce26621a06169fb6728d2d015645d31401de523f)) + # [24.2.0](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.10...v24.2.0) (2021-03-09) diff --git a/package.json b/package.json index a9b88ddd5..9608cd93d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-jest", - "version": "24.2.0", + "version": "24.2.1", "description": "Eslint rules for Jest", "keywords": [ "eslint",