chore: new payload/no-flaky-assertions and payload/no-wait-function eslint rules (#5425)

This commit is contained in:
Alessio Gravili
2024-03-22 10:12:40 -04:00
committed by GitHub
parent a81f7e2a24
commit 8e758ea979
5 changed files with 109 additions and 4 deletions

View File

@@ -4,5 +4,22 @@ module.exports = {
'no-jsx-import-statements': require('./customRules/no-jsx-import-statements'),
'no-non-retryable-assertions': require('./customRules/no-non-retryable-assertions'),
'no-relative-monorepo-imports': require('./customRules/no-relative-monorepo-imports'),
'no-flaky-assertions': require('./customRules/no-flaky-assertions'),
'no-wait-function': {
create: function (context) {
return {
CallExpression(node) {
// Check if the function being called is named "wait"
if (node.callee.name === 'wait') {
context.report({
node,
message:
'Usage of "wait" function is discouraged as it\'s flaky. Proper assertions should be used instead.',
})
}
},
}
},
},
},
}