Skip to content

Commit

Permalink
feat(no-wait-for-side-effects): add to all configs by default (#484)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `no-wait-for-side-effects` is now enabled by default in all configs
  • Loading branch information
MichaelDeBoey committed Oct 13, 2021
1 parent 4cfb3cf commit 0b35c14
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ To enable this configuration use the `extends` property in your
| [`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` | | ![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-side-effects`](./docs/rules/no-wait-for-side-effects.md) | Disallow the use of side effects in `waitFor` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] |
| [`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 | | |
| [`testing-library/prefer-find-by`](./docs/rules/prefer-find-by.md) | Suggest using `find(All)By*` query instead of `waitFor` + `get(All)By*` to wait for elements | 🔧 | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] |
Expand Down
1 change: 1 addition & 0 deletions lib/configs/angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export = {
'testing-library/no-render-in-setup': 'error',
'testing-library/no-wait-for-empty-callback': 'error',
'testing-library/no-wait-for-multiple-assertions': 'error',
'testing-library/no-wait-for-side-effects': 'error',
'testing-library/prefer-find-by': 'error',
'testing-library/prefer-screen-queries': 'error',
'testing-library/render-result-naming-convention': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export = {
'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/no-wait-for-side-effects': 'error',
'testing-library/prefer-find-by': 'error',
'testing-library/prefer-screen-queries': 'error',
},
Expand Down
1 change: 1 addition & 0 deletions lib/configs/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export = {
'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/no-wait-for-side-effects': 'error',
'testing-library/prefer-find-by': 'error',
'testing-library/prefer-screen-queries': 'error',
'testing-library/render-result-naming-convention': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export = {
'testing-library/no-render-in-setup': 'error',
'testing-library/no-wait-for-empty-callback': 'error',
'testing-library/no-wait-for-multiple-assertions': 'error',
'testing-library/no-wait-for-side-effects': 'error',
'testing-library/prefer-find-by': 'error',
'testing-library/prefer-screen-queries': 'error',
'testing-library/render-result-naming-convention': 'error',
Expand Down
8 changes: 4 additions & 4 deletions lib/rules/no-wait-for-side-effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default createTestingLibraryRule<Options, MessageIds>({
description: 'Disallow the use of side effects in `waitFor`',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
react: false,
vue: false,
dom: 'error',
angular: 'error',
react: 'error',
vue: 'error',
},
},
messages: {
Expand Down
4 changes: 4 additions & 0 deletions tests/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Object {
"testing-library/no-render-in-setup": "error",
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/no-wait-for-multiple-assertions": "error",
"testing-library/no-wait-for-side-effects": "error",
"testing-library/prefer-find-by": "error",
"testing-library/prefer-screen-queries": "error",
"testing-library/render-result-naming-convention": "error",
Expand All @@ -37,6 +38,7 @@ Object {
"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/no-wait-for-side-effects": "error",
"testing-library/prefer-find-by": "error",
"testing-library/prefer-screen-queries": "error",
},
Expand Down Expand Up @@ -66,6 +68,7 @@ Object {
],
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/no-wait-for-multiple-assertions": "error",
"testing-library/no-wait-for-side-effects": "error",
"testing-library/prefer-find-by": "error",
"testing-library/prefer-screen-queries": "error",
"testing-library/render-result-naming-convention": "error",
Expand All @@ -91,6 +94,7 @@ Object {
"testing-library/no-render-in-setup": "error",
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/no-wait-for-multiple-assertions": "error",
"testing-library/no-wait-for-side-effects": "error",
"testing-library/prefer-find-by": "error",
"testing-library/prefer-screen-queries": "error",
"testing-library/render-result-naming-convention": "error",
Expand Down

0 comments on commit 0b35c14

Please sign in to comment.