UNPKG

644 BJavaScriptView Raw
1'use strict';
2
3const {visitIf} = require('enhance-visitors');
4const createAvaRule = require('../create-ava-rule');
5const util = require('../util');
6
7const create = context => {
8 const ava = createAvaRule();
9
10 return ava.merge({
11 CallExpression: visitIf([
12 ava.isInTestFile,
13 ava.isTestNode,
14 ])(node => {
15 if (ava.hasTestModifier('todo')) {
16 context.report({
17 node,
18 message: '`test.todo()` should not be used.',
19 });
20 }
21 }),
22 });
23};
24
25module.exports = {
26 create,
27 meta: {
28 type: 'suggestion',
29 docs: {
30 description: 'Ensure no `test.todo()` is used.',
31 url: util.getDocsUrl(__filename),
32 },
33 schema: [],
34 },
35};