UNPKG

557 BJavaScriptView Raw
1'use strict';
2
3const astUtils = require('../util/ast');
4
5module.exports = function (context) {
6 function isPendingMochaTest(node) {
7 return astUtils.isTestCase(node) &&
8 node.arguments.length === 1 &&
9 node.arguments[0].type === 'Literal';
10 }
11
12 return {
13 CallExpression(node) {
14 if (node.callee && isPendingMochaTest(node)) {
15 context.report({
16 node,
17 message: 'Unexpected pending mocha test.'
18 });
19 }
20 }
21 };
22};