From ce815e50116810a63ee61ffd027525430c7ff12a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:43:50 +0100 Subject: [PATCH 1/4] docs: add maisano as a contributor for code, and test (#841) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 1f86f2fc..5e738143 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -639,6 +639,16 @@ "test", "doc" ] + }, + { + "login": "maisano", + "name": "Richard Maisano", + "avatar_url": "https://avatars.githubusercontent.com/u/689081?v=4", + "profile": "https://github.com/maisano", + "contributions": [ + "code", + "test" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 897d06f8..3a2be038 100644 --- a/README.md +++ b/README.md @@ -425,6 +425,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Nathan
Nathan

💻 ⚠️ justintoman
justintoman

💻 ⚠️ Anthony Devick
Anthony Devick

💻 ⚠️ 📖 + Richard Maisano
Richard Maisano

💻 ⚠️ From a1bb21ea01e2a7cfa393e5e360aa3d620098efae Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Thu, 9 Nov 2023 11:53:32 +0300 Subject: [PATCH 2/4] fix(await-async-events): avoid reporting `userEvent.setup()` in wrappers (#834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(await-async-events): sync userEvent.setup() should not be reported Better fix for #800 Co-authored-by: Mario Beltrán --- lib/rules/await-async-events.ts | 7 ++++--- tests/lib/rules/await-async-events.test.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/rules/await-async-events.ts b/lib/rules/await-async-events.ts index 96adfcb2..6ca29473 100644 --- a/lib/rules/await-async-events.ts +++ b/lib/rules/await-async-events.ts @@ -91,9 +91,6 @@ export default createTestingLibraryRule({ messageId?: MessageIds; fix?: TSESLint.ReportFixFunction; }): void { - if (node.name === USER_EVENT_SETUP_FUNCTION_NAME) { - return; - } if (!isPromiseHandled(node)) { context.report({ node: closestCallExpression.callee, @@ -136,6 +133,10 @@ export default createTestingLibraryRule({ return; } + if (node.name === USER_EVENT_SETUP_FUNCTION_NAME) { + return; + } + const references = getVariableReferences( context, closestCallExpression.parent diff --git a/tests/lib/rules/await-async-events.test.ts b/tests/lib/rules/await-async-events.test.ts index 2f0ce78e..ba7110a5 100644 --- a/tests/lib/rules/await-async-events.test.ts +++ b/tests/lib/rules/await-async-events.test.ts @@ -204,6 +204,19 @@ ruleTester.run(RULE_NAME, rule, { `, options: [{ eventModule: 'userEvent' }] as const, }, + { + code: ` + import userEvent from '${testingFramework}' + function customSetup() { + const user = userEvent.setup(); + return { user }; + } + test('setup method called and returned is valid', () => { + const { user } = customSetup(); + }) + `, + options: [{ eventModule: 'userEvent' }] as const, + }, ...USER_EVENT_ASYNC_FUNCTIONS.map((eventMethod) => ({ code: ` import userEvent from '${testingFramework}' From 05e94fac6374d6ac8fb7ea048764b8f68da67811 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:57:12 +0100 Subject: [PATCH 3/4] docs: add doochik as a contributor for code, and test (#842) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 5e738143..3e5d8940 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -649,6 +649,16 @@ "code", "test" ] + }, + { + "login": "doochik", + "name": "Aleksei Androsov", + "avatar_url": "https://avatars.githubusercontent.com/u/31961?v=4", + "profile": "https://github.com/doochik", + "contributions": [ + "code", + "test" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 3a2be038..668dd441 100644 --- a/README.md +++ b/README.md @@ -426,6 +426,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d justintoman
justintoman

💻 ⚠️ Anthony Devick
Anthony Devick

💻 ⚠️ 📖 Richard Maisano
Richard Maisano

💻 ⚠️ + Aleksei Androsov
Aleksei Androsov

💻 ⚠️ From 9709343fed685a983ab12cffae68f24ecd48164f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n?= Date: Thu, 9 Nov 2023 10:04:32 +0000 Subject: [PATCH 4/4] chore: trigger release manually