diff --git a/README.md b/README.md index 8fc62d0c..71b02d21 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ To enable this configuration use the `extends` property in your | [`testing-library/no-render-in-setup`](./docs/rules/no-render-in-setup.md) | Disallow the use of `render` in testing frameworks setup functions | | | | [`testing-library/no-unnecessary-act`](./docs/rules/no-unnecessary-act.md) | Disallow wrapping Testing Library utils or empty callbacks in `act` | | ![react-badge][] | | [`testing-library/no-wait-for-empty-callback`](./docs/rules/no-wait-for-empty-callback.md) | Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | -| [`testing-library/no-wait-for-multiple-assertions`](./docs/rules/no-wait-for-multiple-assertions.md) | Disallow the use of multiple `expect` calls inside `waitFor` | | | +| [`testing-library/no-wait-for-multiple-assertions`](./docs/rules/no-wait-for-multiple-assertions.md) | Disallow the use of multiple `expect` calls inside `waitFor` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | [`testing-library/no-wait-for-side-effects`](./docs/rules/no-wait-for-side-effects.md) | Disallow the use of side effects in `waitFor` | | | | [`testing-library/no-wait-for-snapshot`](./docs/rules/no-wait-for-snapshot.md) | Ensures no snapshot is generated inside of a `waitFor` call | | | | [`testing-library/prefer-explicit-assert`](./docs/rules/prefer-explicit-assert.md) | Suggest using explicit assertions rather than standalone queries | | | diff --git a/lib/configs/angular.ts b/lib/configs/angular.ts index ab1060b1..5c7d564d 100644 --- a/lib/configs/angular.ts +++ b/lib/configs/angular.ts @@ -14,6 +14,7 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-wait-for-empty-callback': 'error', + 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/prefer-find-by': 'error', 'testing-library/prefer-screen-queries': 'error', 'testing-library/render-result-naming-convention': 'error', diff --git a/lib/configs/dom.ts b/lib/configs/dom.ts index 261cde83..7ed01a78 100644 --- a/lib/configs/dom.ts +++ b/lib/configs/dom.ts @@ -10,6 +10,7 @@ export = { 'testing-library/no-await-sync-query': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-wait-for-empty-callback': 'error', + 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/prefer-find-by': 'error', 'testing-library/prefer-screen-queries': 'error', }, diff --git a/lib/configs/react.ts b/lib/configs/react.ts index 1c8b3b4b..af8b11d1 100644 --- a/lib/configs/react.ts +++ b/lib/configs/react.ts @@ -15,6 +15,7 @@ export = { 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-unnecessary-act': ['error', { isStrict: true }], 'testing-library/no-wait-for-empty-callback': 'error', + 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/prefer-find-by': 'error', 'testing-library/prefer-screen-queries': 'error', 'testing-library/render-result-naming-convention': 'error', diff --git a/lib/configs/vue.ts b/lib/configs/vue.ts index 9cb7b0a2..09b64871 100644 --- a/lib/configs/vue.ts +++ b/lib/configs/vue.ts @@ -15,6 +15,7 @@ export = { 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', 'testing-library/no-wait-for-empty-callback': 'error', + 'testing-library/no-wait-for-multiple-assertions': 'error', 'testing-library/prefer-find-by': 'error', 'testing-library/prefer-screen-queries': 'error', 'testing-library/render-result-naming-convention': 'error', diff --git a/lib/rules/no-wait-for-multiple-assertions.ts b/lib/rules/no-wait-for-multiple-assertions.ts index 86499e89..171dd290 100644 --- a/lib/rules/no-wait-for-multiple-assertions.ts +++ b/lib/rules/no-wait-for-multiple-assertions.ts @@ -19,10 +19,10 @@ export default createTestingLibraryRule({ 'Disallow the use of multiple `expect` calls inside `waitFor`', category: 'Best Practices', recommendedConfig: { - dom: false, - angular: false, - react: false, - vue: false, + dom: 'error', + angular: 'error', + react: 'error', + vue: 'error', }, }, messages: { diff --git a/tests/__snapshots__/index.test.ts.snap b/tests/__snapshots__/index.test.ts.snap index bd21457f..c5022053 100644 --- a/tests/__snapshots__/index.test.ts.snap +++ b/tests/__snapshots__/index.test.ts.snap @@ -19,6 +19,7 @@ Object { "testing-library/no-node-access": "error", "testing-library/no-promise-in-fire-event": "error", "testing-library/no-wait-for-empty-callback": "error", + "testing-library/no-wait-for-multiple-assertions": "error", "testing-library/prefer-find-by": "error", "testing-library/prefer-screen-queries": "error", "testing-library/render-result-naming-convention": "error", @@ -34,6 +35,7 @@ Object { "testing-library/no-await-sync-query": "error", "testing-library/no-promise-in-fire-event": "error", "testing-library/no-wait-for-empty-callback": "error", + "testing-library/no-wait-for-multiple-assertions": "error", "testing-library/prefer-find-by": "error", "testing-library/prefer-screen-queries": "error", }, @@ -61,6 +63,7 @@ Object { }, ], "testing-library/no-wait-for-empty-callback": "error", + "testing-library/no-wait-for-multiple-assertions": "error", "testing-library/prefer-find-by": "error", "testing-library/prefer-screen-queries": "error", "testing-library/render-result-naming-convention": "error", @@ -84,6 +87,7 @@ Object { "testing-library/no-node-access": "error", "testing-library/no-promise-in-fire-event": "error", "testing-library/no-wait-for-empty-callback": "error", + "testing-library/no-wait-for-multiple-assertions": "error", "testing-library/prefer-find-by": "error", "testing-library/prefer-screen-queries": "error", "testing-library/render-result-naming-convention": "error",