您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

31 行
889 B

'use strict';
const createAstUtils = require('../util/ast');
module.exports = {
meta: {
docs: {
description: 'Disallow skipped tests'
},
type: 'problem'
},
create(context) {
const astUtils = createAstUtils(context.settings);
return {
CallExpression(node) {
const options = { modifiers: [ 'skip' ], modifiersOnly: true };
if (astUtils.isDescribe(node, options) || astUtils.isTestCase(node, options)) {
const callee = node.callee;
const nodeToReport = callee.type === 'MemberExpression' ? callee.property : callee;
context.report({
node: nodeToReport,
message: 'Unexpected skipped mocha test.'
});
}
}
};
}
};