Add linting rule for cypress tests to reject .only calls

This commit is contained in:
Ramon Wenger 2024-03-07 13:15:29 +01:00
parent 0cf39373da
commit f080e946c4
1 changed files with 7 additions and 0 deletions

View File

@ -103,5 +103,12 @@ module.exports = {
caughtErrorsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_',
}, },
], ],
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.object.name=/^(describe|it|test)$/][callee.property.name='only']",
message: 'Found .only in test. Please remove it before committing.',
},
],
}, },
}; };