@@ -37,8 +37,38 @@ ruleTester.run(RULE_NAME, rule, {
37
37
utils.findByRole('button', {name: /hello/i})
38
38
` ,
39
39
`
40
- const {queryAllByPlaceholderText} = render(<Component/>)
41
- queryAllByPlaceholderText(/hello/i)
40
+ const {queryAllByPlaceholderText} = render(<Component/>)
41
+ queryAllByPlaceholderText(/hello/i)
42
+ ` ,
43
+ `
44
+ const text = 'hello';
45
+ /hello/g.test(text)
46
+ text.match(/hello/g)
47
+ ` ,
48
+ `
49
+ const text = somethingElse()
50
+ /hello/g.test(text)
51
+ text.match(/hello/g)
52
+ ` ,
53
+ `
54
+ import somethingElse from 'somethingElse'
55
+ somethingElse.lookup(/hello/g)
56
+ ` ,
57
+ `
58
+ import { screen } from '@testing-library/dom'
59
+ screen.notAQuery(/hello/g)
60
+ ` ,
61
+ `
62
+ import { screen } from '@testing-library/dom'
63
+ screen.notAQuery('button', {name: /hello/g})
64
+ ` ,
65
+ `
66
+ const utils = render(<Component/>)
67
+ utils.notAQuery('button', {name: /hello/i})
68
+ ` ,
69
+ `
70
+ const utils = render(<Component/>)
71
+ utils.notAQuery(/hello/i)
42
72
` ,
43
73
] ,
44
74
invalid : [
@@ -59,6 +89,8 @@ ruleTester.run(RULE_NAME, rule, {
59
89
errors : [
60
90
{
61
91
messageId : 'noGlobalRegExpFlagInQuery' ,
92
+ line : 3 ,
93
+ column : 46 ,
62
94
} ,
63
95
] ,
64
96
} ,
@@ -69,6 +101,8 @@ ruleTester.run(RULE_NAME, rule, {
69
101
errors : [
70
102
{
71
103
messageId : 'noGlobalRegExpFlagInQuery' ,
104
+ line : 3 ,
105
+ column : 65 ,
72
106
} ,
73
107
] ,
74
108
} ,
@@ -79,6 +113,8 @@ ruleTester.run(RULE_NAME, rule, {
79
113
errors : [
80
114
{
81
115
messageId : 'noGlobalRegExpFlagInQuery' ,
116
+ line : 3 ,
117
+ column : 47 ,
82
118
} ,
83
119
] ,
84
120
} ,
@@ -89,6 +125,8 @@ ruleTester.run(RULE_NAME, rule, {
89
125
errors : [
90
126
{
91
127
messageId : 'noGlobalRegExpFlagInQuery' ,
128
+ line : 3 ,
129
+ column : 33 ,
92
130
} ,
93
131
] ,
94
132
} ,
0 commit comments