diff --git a/README.md b/README.md index 8fc62d0c..3c9584f1 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ To enable this configuration use the `extends` property in your | [`testing-library/no-manual-cleanup`](./docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | | | [`testing-library/no-node-access`](./docs/rules/no-node-access.md) | Disallow direct Node access | | ![angular-badge][] ![react-badge][] ![vue-badge][] | | [`testing-library/no-promise-in-fire-event`](./docs/rules/no-promise-in-fire-event.md) | Disallow the use of promises passed to a `fireEvent` method | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | -| [`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-render-in-setup`](./docs/rules/no-render-in-setup.md) | Disallow the use of `render` in testing frameworks setup functions | | ![angular-badge][] ![react-badge][] ![vue-badge][] | | [`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` | | | diff --git a/lib/configs/angular.ts b/lib/configs/angular.ts index ab1060b1..606ce334 100644 --- a/lib/configs/angular.ts +++ b/lib/configs/angular.ts @@ -13,6 +13,7 @@ export = { 'testing-library/no-dom-import': ['error', 'angular'], 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', + 'testing-library/no-render-in-setup': 'error', 'testing-library/no-wait-for-empty-callback': '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..33be2846 100644 --- a/lib/configs/react.ts +++ b/lib/configs/react.ts @@ -13,6 +13,7 @@ export = { 'testing-library/no-dom-import': ['error', 'react'], 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', + 'testing-library/no-render-in-setup': 'error', 'testing-library/no-unnecessary-act': ['error', { isStrict: true }], 'testing-library/no-wait-for-empty-callback': 'error', 'testing-library/prefer-find-by': 'error', diff --git a/lib/configs/vue.ts b/lib/configs/vue.ts index 9cb7b0a2..e8129940 100644 --- a/lib/configs/vue.ts +++ b/lib/configs/vue.ts @@ -14,6 +14,7 @@ export = { 'testing-library/no-dom-import': ['error', 'vue'], 'testing-library/no-node-access': 'error', 'testing-library/no-promise-in-fire-event': 'error', + 'testing-library/no-render-in-setup': 'error', 'testing-library/no-wait-for-empty-callback': 'error', 'testing-library/prefer-find-by': 'error', 'testing-library/prefer-screen-queries': 'error', diff --git a/lib/rules/no-render-in-setup.ts b/lib/rules/no-render-in-setup.ts index e5c7f437..89db8ef6 100644 --- a/lib/rules/no-render-in-setup.ts +++ b/lib/rules/no-render-in-setup.ts @@ -53,9 +53,9 @@ export default createTestingLibraryRule({ category: 'Best Practices', recommendedConfig: { dom: false, - angular: false, - react: false, - vue: false, + 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..339d0be4 100644 --- a/tests/__snapshots__/index.test.ts.snap +++ b/tests/__snapshots__/index.test.ts.snap @@ -18,6 +18,7 @@ Object { ], "testing-library/no-node-access": "error", "testing-library/no-promise-in-fire-event": "error", + "testing-library/no-render-in-setup": "error", "testing-library/no-wait-for-empty-callback": "error", "testing-library/prefer-find-by": "error", "testing-library/prefer-screen-queries": "error", @@ -54,6 +55,7 @@ Object { ], "testing-library/no-node-access": "error", "testing-library/no-promise-in-fire-event": "error", + "testing-library/no-render-in-setup": "error", "testing-library/no-unnecessary-act": Array [ "error", Object { @@ -83,6 +85,7 @@ Object { ], "testing-library/no-node-access": "error", "testing-library/no-promise-in-fire-event": "error", + "testing-library/no-render-in-setup": "error", "testing-library/no-wait-for-empty-callback": "error", "testing-library/prefer-find-by": "error", "testing-library/prefer-screen-queries": "error",