Skip to content

Commit

Permalink
chore: recommend no-wait-for-empty-callback
Browse files Browse the repository at this point in the history
BREAKING CHANGE: recommend no-wait-for-empty-callback
  • Loading branch information
nickmccurdy committed Jun 17, 2020
1 parent 185180a commit 2bb889b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
[![Tweet][tweet-badge]][tweet-url]

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-24-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

## Installation
Expand Down Expand Up @@ -141,7 +143,7 @@ To enable this configuration use the `extends` property in your
| [no-debug](docs/rules/no-debug.md) | Disallow the use of `debug` | ![angular-badge][] ![react-badge][] ![vue-badge][] | |
| [no-dom-import](docs/rules/no-dom-import.md) | Disallow importing from DOM Testing Library | ![angular-badge][] ![react-badge][] ![vue-badge][] | ![fixable-badge][] |
| [no-manual-cleanup](docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | |
| [no-wait-for-empty-callback](docs/rules/no-wait-for-empty-callback.md) | Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved` | | |
| [no-wait-for-empty-callback](docs/rules/no-wait-for-empty-callback.md) | Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved` | ![recommended-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | |
| [prefer-explicit-assert](docs/rules/prefer-explicit-assert.md) | Suggest using explicit assertions rather than just `getBy*` queries | | |
| [prefer-find-by](docs/rules/prefer-find-by.md) | Suggest using `findBy*` methods instead of the `waitFor` + `getBy` queries | ![recommended-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | ![fixable-badge][] |
| [prefer-presence-queries](docs/rules/prefer-presence-queries.md) | Enforce specific queries when checking element is present or not | | |
Expand Down Expand Up @@ -212,6 +214,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
1 change: 1 addition & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const recommendedRules = {
'testing-library/await-async-query': 'error',
'testing-library/await-async-utils': 'error',
'testing-library/no-await-sync-query': 'error',
'testing-library/no-wait-for-empty-callback': 'error',
'testing-library/prefer-find-by': 'error',
};

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-wait-for-empty-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
description:
"It's preferred to avoid empty callbacks in `waitFor` and `waitForElementToBeRemoved`",
category: 'Best Practices',
recommended: false,
recommended: 'error',
},
messages: {
noWaitForEmptyCallback:
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 @@ -14,6 +14,7 @@ Object {
"error",
"angular",
],
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/prefer-find-by": "error",
},
}
Expand All @@ -33,6 +34,7 @@ Object {
"error",
"react",
],
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/prefer-find-by": "error",
},
}
Expand All @@ -47,6 +49,7 @@ Object {
"testing-library/await-async-query": "error",
"testing-library/await-async-utils": "error",
"testing-library/no-await-sync-query": "error",
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/prefer-find-by": "error",
},
}
Expand All @@ -67,6 +70,7 @@ Object {
"error",
"vue",
],
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/prefer-find-by": "error",
},
}
Expand Down

0 comments on commit 2bb889b

Please sign in to comment.