mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Remove skipped telemetry tests (no-changelog) (#10319)
This commit is contained in:
@@ -182,12 +182,14 @@ module.exports = {
|
||||
messages: {
|
||||
removeSkip: 'Remove `.skip()` call',
|
||||
removeOnly: 'Remove `.only()` call',
|
||||
removeXPrefix: 'Remove `x` prefix',
|
||||
},
|
||||
fixable: 'code',
|
||||
},
|
||||
create(context) {
|
||||
const TESTING_FUNCTIONS = new Set(['test', 'it', 'describe']);
|
||||
const SKIPPING_METHODS = new Set(['skip', 'only']);
|
||||
const PREFIXED_TESTING_FUNCTIONS = new Set(['xtest', 'xit', 'xdescribe']);
|
||||
const toMessageId = (s) => 'remove' + s.charAt(0).toUpperCase() + s.slice(1);
|
||||
|
||||
return {
|
||||
@@ -208,6 +210,18 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
},
|
||||
CallExpression(node) {
|
||||
if (
|
||||
node.callee.type === 'Identifier' &&
|
||||
PREFIXED_TESTING_FUNCTIONS.has(node.callee.name)
|
||||
) {
|
||||
context.report({
|
||||
messageId: 'removeXPrefix',
|
||||
node,
|
||||
fix: (fixer) => fixer.replaceText(node.callee, 'test'),
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user