You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(no-debug): support more debugging functions (#357)
* feat(no-debug): support `utilNames` option
* fix(no-debug): only accept known debug utils
* refactor: merge `isDebugUtil` & `isOneOfDebugUtils` utils
* docs(no-debug): mention which utils are checked for by default
* fix(no-debug): mark `utilNames` as optional
* test(no-debug): add new case
* feat(no-debug): accept `utilsToCheckFor` property option
* feat: support more `DEBUG_UTILS`
* docs(no-debug): update with details of new functionality
* docs(no-debug): include list of debug utils and more complete example
Copy file name to clipboardExpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ To enable this configuration use the `extends` property in your
187
187
|[testing-library/no-await-sync-events](docs/rules/no-await-sync-events.md)| Disallow unnecessary `await` for sync events |||
188
188
|[testing-library/no-await-sync-query](docs/rules/no-await-sync-query.md)| Disallow unnecessary `await` for sync queries |![dom-badge][]![angular-badge][]![react-badge][]![vue-badge][]||
189
189
|[testing-library/no-container](docs/rules/no-container.md)| Disallow the use of `container` methods |![angular-badge][]![react-badge][]![vue-badge][]||
190
-
|[testing-library/no-debug](docs/rules/no-debug.md)| Disallow the use of `debug`|![angular-badge][]![react-badge][]![vue-badge][]||
190
+
|[testing-library/no-debug](docs/rules/no-debug.md)| Disallow the use of debugging utilities like `debug`|![angular-badge][]![react-badge][]![vue-badge][]||
191
191
|[testing-library/no-dom-import](docs/rules/no-dom-import.md)| Disallow importing from DOM Testing Library |![angular-badge][]![react-badge][]![vue-badge][]|![fixable-badge][]|
192
192
|[testing-library/no-manual-cleanup](docs/rules/no-manual-cleanup.md)| Disallow the use of `cleanup`|||
193
193
|[testing-library/no-node-access](docs/rules/no-node-access.md)| Disallow direct Node access |![angular-badge][]![react-badge][]![vue-badge][]||
Copy file name to clipboardExpand all lines: docs/rules/no-debug.md
+28-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,19 @@
1
-
# Disallow the use of `debug` (`testing-library/no-debug`)
1
+
# Disallow the use of debugging utilities like `debug` (`testing-library/no-debug`)
2
2
3
3
Just like `console.log` statements pollutes the browser's output, debug statements also pollutes the tests if one of your teammates forgot to remove it. `debug` statements should be used when you actually want to debug your tests but should not be pushed to the codebase.
4
4
5
5
## Rule Details
6
6
7
-
This rule aims to disallow the use of `debug` in your tests.
7
+
This rule supports disallowing the following debugging utilities:
8
+
9
+
-`debug`
10
+
-`logTestingPlaygroundURL`
11
+
-`prettyDOM`
12
+
-`logRoles`
13
+
-`logDOM`
14
+
-`prettyFormat`
15
+
16
+
By default, only `debug` and `logTestingPlaygroundURL` are disallowed.
0 commit comments