UNPKG

eslint-plugin-mocha

Version:

Eslint rules for mocha.

21 lines 739 B
import { isCallExpression } from '../ast/node-types.js'; const suiteConfig = new Set(['timeout', 'slow', 'retries']); function getPropertyName(property) { return property.name ?? property.value; } function isSuiteConfigExpression(node) { if (node.type !== 'MemberExpression') { return false; } const usingThis = node.object.type === 'ThisExpression'; if (usingThis) { return suiteConfig.has(getPropertyName( // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ok node.property)); } return false; } export function isSuiteConfigCall(node) { return isCallExpression(node) && isSuiteConfigExpression(node.callee); } //# sourceMappingURL=config-call.js.map