eslint-plugin-test-flakiness 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,16 @@ module.exports = {
|
|
|
16
16
|
url: 'https://github.com/tigredonorte/eslint-plugin-test-flakiness/blob/main/docs/rules/no-element-removal-check.md'
|
|
17
17
|
},
|
|
18
18
|
fixable: 'code',
|
|
19
|
-
schema: [
|
|
19
|
+
schema: [{
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
reportWithoutEvidence: {
|
|
23
|
+
type: 'boolean',
|
|
24
|
+
default: true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
additionalProperties: false
|
|
28
|
+
}],
|
|
20
29
|
messages: {
|
|
21
30
|
avoidRemovalCheck: 'Checking for element removal can be flaky. Use waitForElementToBeRemoved or wait for a positive condition instead.',
|
|
22
31
|
useWaitForRemoval: 'Avoid checking for null/undefined without proper waiting. Wrap in waitFor() to handle timing.',
|
|
@@ -33,6 +42,9 @@ module.exports = {
|
|
|
33
42
|
return {};
|
|
34
43
|
}
|
|
35
44
|
|
|
45
|
+
const options = context.options[0] || {};
|
|
46
|
+
const reportWithoutEvidence = options.reportWithoutEvidence !== false;
|
|
47
|
+
|
|
36
48
|
function isInsideWaitFor(node) {
|
|
37
49
|
let parent = node.parent;
|
|
38
50
|
while (parent && parent.type !== 'Program') {
|
|
@@ -217,7 +229,7 @@ module.exports = {
|
|
|
217
229
|
messageId: 'avoidNotInDocument',
|
|
218
230
|
fix: createWaitForFix(node)
|
|
219
231
|
});
|
|
220
|
-
} else {
|
|
232
|
+
} else if (reportWithoutEvidence) {
|
|
221
233
|
context.report({
|
|
222
234
|
node,
|
|
223
235
|
messageId: 'avoidNotInDocumentNoEvidence'
|
|
@@ -262,7 +274,7 @@ module.exports = {
|
|
|
262
274
|
messageId: 'useWaitForRemoval',
|
|
263
275
|
fix: createWaitForFix(node)
|
|
264
276
|
});
|
|
265
|
-
} else {
|
|
277
|
+
} else if (reportWithoutEvidence) {
|
|
266
278
|
context.report({
|
|
267
279
|
node,
|
|
268
280
|
messageId: 'useWaitForRemovalNoEvidence'
|
|
@@ -307,7 +319,7 @@ module.exports = {
|
|
|
307
319
|
messageId: 'useWaitForRemoval',
|
|
308
320
|
fix: createWaitForFix(node)
|
|
309
321
|
});
|
|
310
|
-
} else {
|
|
322
|
+
} else if (reportWithoutEvidence) {
|
|
311
323
|
context.report({
|
|
312
324
|
node,
|
|
313
325
|
messageId: 'useWaitForRemovalNoEvidence'
|
|
@@ -339,7 +351,7 @@ module.exports = {
|
|
|
339
351
|
node,
|
|
340
352
|
messageId: 'useWaitForRemoval'
|
|
341
353
|
});
|
|
342
|
-
} else {
|
|
354
|
+
} else if (reportWithoutEvidence) {
|
|
343
355
|
context.report({
|
|
344
356
|
node,
|
|
345
357
|
messageId: 'useWaitForRemovalNoEvidence'
|
|
@@ -366,7 +378,7 @@ module.exports = {
|
|
|
366
378
|
messageId: 'avoidNotVisibleWithoutWaitFor',
|
|
367
379
|
fix: createWaitForFix(node)
|
|
368
380
|
});
|
|
369
|
-
} else {
|
|
381
|
+
} else if (reportWithoutEvidence) {
|
|
370
382
|
context.report({
|
|
371
383
|
node,
|
|
372
384
|
messageId: 'avoidNotVisibleNoEvidence'
|