Skip to content

Commit 497c27f

Browse files
fix: loosen regex in no-commented-tests (fixes #61) (#415)
1 parent a07bef3 commit 497c27f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/rules/no-commented-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
create: function (context) {
2727
const sourceCode = context.getSourceCode(),
2828
newlineRegExp = /\r\n|\r|\n/g,
29-
warningRegExp = /\b(QUnit\.test|QUnit\.asyncTest|QUnit\.skip|test|asyncTest)\s*\(/g;
29+
warningRegExp = /\b(QUnit\.test|QUnit\.asyncTest|QUnit\.skip|test|asyncTest)\s*\(\s*["'`]/g;
3030

3131
function getNewlineIndexes(text) {
3232
const indexes = [];

tests/lib/rules/no-commented-tests.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ ruleTester.run("no-commented-tests", rule, {
2323
"QUnit.skip('Name', function () { ok(true); });",
2424

2525
// shebang comments
26-
"#!/some-test()"
26+
"#!/some-test()",
27+
28+
// Allow test, parentheses, no quote (https://github.com/platinumazure/eslint-plugin-qunit/issues/61)
29+
"// TODO: refactor with a Component test (instead of an Acceptance test)",
30+
"// Run actual test (without context)."
2731
],
2832

2933
invalid: [

0 commit comments

Comments
 (0)