25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
792 B

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