eslint-plugin-mocha
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -0,1 +1,7 @@ | ||
## 6.1.1 (September 11, 2019) | ||
### Bug Fixes | ||
* Fix no-setup-in-describe to allow Mocha suite config ([#209](https://github.com/lo1tuma/eslint-plugin-mocha/pull/209)) | ||
## 6.1.0 (August 22, 2019) | ||
@@ -2,0 +8,0 @@ |
@@ -16,3 +16,5 @@ 'use strict'; | ||
function isPureNode(node) { | ||
return astUtils.isHookCall(node) || astUtils.isTestCase(node); | ||
return astUtils.isHookCall(node) || | ||
astUtils.isTestCase(node) || | ||
astUtils.isSuiteConfigCall(node); | ||
} | ||
@@ -19,0 +21,0 @@ |
@@ -14,2 +14,3 @@ 'use strict'; | ||
const hooks = [ 'before', 'after', 'beforeEach', 'afterEach', 'beforeAll', 'afterAll' ]; | ||
const suiteConfig = [ 'timeout', 'slow', 'retries' ]; | ||
const testCaseNames = [ | ||
@@ -47,2 +48,12 @@ 'it', 'it.only', 'it.skip', 'xit', | ||
function isSuiteConfigExpression(node) { | ||
return node.type === 'MemberExpression' && | ||
node.object.type === 'ThisExpression' && | ||
suiteConfig.indexOf(getPropertyName(node.property)) !== -1; | ||
} | ||
function isSuiteConfigCall(node) { | ||
return isCallExpression(node) && isSuiteConfigExpression(node.callee); | ||
} | ||
function isTestCase(node) { | ||
@@ -107,2 +118,3 @@ return isCallExpression(node) && testCaseNames.indexOf(getNodeName(node.callee)) > -1; | ||
isHookCall, | ||
isSuiteConfigCall, | ||
isStringLiteral, | ||
@@ -109,0 +121,0 @@ hasParentMochaFunctionCall, |
{ | ||
"name": "eslint-plugin-mocha", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Eslint rules for mocha.", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67838
1443