Skip to content

Commit 908fa2d

Browse files
committed
test(no-wait-for-empty-callback): improve invalid asserts
1 parent 5720a80 commit 908fa2d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/lib/rules/no-wait-for-empty-callback.test.ts

+35
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,38 @@ ruleTester.run(RULE_NAME, rule, {
3636
code: `${m}(() => {})`,
3737
errors: [
3838
{
39+
line: 1,
40+
column: 8 + m.length,
3941
messageId: 'noWaitForEmptyCallback',
42+
data: {
43+
methodName: m,
44+
},
4045
},
4146
],
4247
})),
4348
...ALL_WAIT_METHODS.map((m) => ({
4449
code: `${m}((a, b) => {})`,
4550
errors: [
4651
{
52+
line: 1,
53+
column: 12 + m.length,
4754
messageId: 'noWaitForEmptyCallback',
55+
data: {
56+
methodName: m,
57+
},
4858
},
4959
],
5060
})),
5161
...ALL_WAIT_METHODS.map((m) => ({
5262
code: `${m}(() => { /* I'm empty anyway */ })`,
5363
errors: [
5464
{
65+
line: 1,
66+
column: 8 + m.length,
5567
messageId: 'noWaitForEmptyCallback',
68+
data: {
69+
methodName: m,
70+
},
5671
},
5772
],
5873
})),
@@ -63,7 +78,12 @@ ruleTester.run(RULE_NAME, rule, {
6378
})`,
6479
errors: [
6580
{
81+
line: 1,
82+
column: 13 + m.length,
6683
messageId: 'noWaitForEmptyCallback',
84+
data: {
85+
methodName: m,
86+
},
6787
},
6888
],
6989
})),
@@ -73,7 +93,12 @@ ruleTester.run(RULE_NAME, rule, {
7393
})`,
7494
errors: [
7595
{
96+
line: 1,
97+
column: 14 + m.length,
7698
messageId: 'noWaitForEmptyCallback',
99+
data: {
100+
methodName: m,
101+
},
77102
},
78103
],
79104
})),
@@ -83,7 +108,12 @@ ruleTester.run(RULE_NAME, rule, {
83108
})`,
84109
errors: [
85110
{
111+
line: 1,
112+
column: 13 + m.length,
86113
messageId: 'noWaitForEmptyCallback',
114+
data: {
115+
methodName: m,
116+
},
87117
},
88118
],
89119
})),
@@ -92,7 +122,12 @@ ruleTester.run(RULE_NAME, rule, {
92122
code: `${m}(noop)`,
93123
errors: [
94124
{
125+
line: 1,
126+
column: 2 + m.length,
95127
messageId: 'noWaitForEmptyCallback',
128+
data: {
129+
methodName: m,
130+
},
96131
},
97132
],
98133
})),

0 commit comments

Comments
 (0)