Skip to content

Commit 1740ee7

Browse files
kangaxSimenB
authored andcommitted
fix(add-no-commented-out): correct false positives (#271)
1 parent 1ce1402 commit 1740ee7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/rules/__tests__/no-commented-out-tests.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ ruleTester.run('no-commented-out-tests', rule, {
2424
'(a || b).f()',
2525
'itHappensToStartWithIt()',
2626
'testSomething()',
27+
'// latest(dates)',
28+
'// TODO: unify with Git implementation from Shipit (?)',
2729
[
2830
'import { pending } from "actions"',
2931
'',

src/rules/no-commented-out-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { getDocsUrl } = require('./util');
55
const message = 'Some tests seem to be commented';
66

77
function hasTests(node) {
8-
return /(x|f)?(test|it|describe)(\.\w+|\[['"]\w+['"]\])?\s*\(/m.test(
8+
return /^\s*(x|f)?(test|it|describe)(\.\w+|\[['"]\w+['"]\])?\s*\(/m.test(
99
node.value,
1010
);
1111
}

0 commit comments

Comments
 (0)