Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

32 rader
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.'
});
}
}
};
}
};