Skip to content

Commit 5b320a4

Browse files
committed
feat: support more DEBUG_UTILS
1 parent 1e57024 commit 5b320a4

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

lib/utils/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@ const ASYNC_UTILS = [
6767
] as const;
6868

6969
const DEBUG_UTILS = [
70-
'debug', //
70+
'debug',
7171
'logTestingPlaygroundURL',
72+
'prettyDOM',
73+
'logRoles',
74+
'logDOM',
75+
'prettyFormat',
7276
] as const;
7377

7478
const EVENTS_SIMULATORS = ['fireEvent', 'userEvent'] as const;

tests/lib/rules/no-debug.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,34 @@ ruleTester.run(RULE_NAME, rule, {
447447
},
448448
],
449449
},
450+
{
451+
code: `
452+
import { logRoles } from '@testing-library/dom'
453+
logRoles(document.createElement('nav'))
454+
`,
455+
options: [{ utilsToCheckFor: { logRoles: true } }],
456+
errors: [
457+
{
458+
line: 3,
459+
column: 9,
460+
messageId: 'noDebug',
461+
},
462+
],
463+
},
464+
{
465+
code: `
466+
import { screen } from '@testing-library/dom'
467+
screen.logTestingPlaygroundURL()
468+
`,
469+
options: [{ utilsToCheckFor: { logRoles: true } }],
470+
errors: [
471+
{
472+
line: 3,
473+
column: 16,
474+
messageId: 'noDebug',
475+
},
476+
],
477+
},
450478
{
451479
code: `
452480
import { screen } from '@testing-library/dom'

0 commit comments

Comments
 (0)