Skip to content
Permalink
Browse files
fix(lowercase-name): ignore all top level describes when option is tr…
…ue (#614)

closes #613
  • Loading branch information
G-Rath committed Jun 23, 2020
1 parent 9262f46 commit 624018aa181e7c0ce87457a4f9c212c7891987a8
Showing with 21 additions and 0 deletions.
  1. +16 −0 src/rules/__tests__/lowercase-name.test.ts
  2. +5 −0 src/rules/lowercase-name.ts
@@ -271,6 +271,22 @@ ruleTester.run('lowercase-name with ignoreTopLevelDescribe', rule, {
`,
options: [{ ignoreTopLevelDescribe: true }],
},
{
code: dedent`
describe('Strings', () => {
it('are strings', () => {
expect('abc').toBe('abc');
});
});
describe('Booleans', () => {
it('are booleans', () => {
expect(true).toBe(true);
});
});
`,
options: [{ ignoreTopLevelDescribe: true }],
},
],
invalid: [
{
@@ -158,6 +158,11 @@ export default createRule<
});
}
},
'CallExpression:exit'(node: TSESTree.CallExpression) {
if (isDescribe(node)) {
numberOfDescribeBlocks--;
}
},
};
},
});

0 comments on commit 624018a

Please sign in to comment.