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

32 行
815 B

'use strict';
const createAstUtils = require('../util/ast');
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Disallow pending tests'
}
},
create(context) {
const astUtils = createAstUtils(context.settings);
function isPendingMochaTest(node) {
return astUtils.isTestCase(node) &&
node.arguments.length === 1 &&
node.arguments[0].type === 'Literal';
}
return {
CallExpression(node) {
if (node.callee && isPendingMochaTest(node)) {
context.report({
node,
message: 'Unexpected pending mocha test.'
});
}
}
};
}
};