eslint-plugin-jest 24.0.1 → 24.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/lib/rules/no-if.js +4 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [24.0.2](https://github.com/jest-community/eslint-plugin-jest/compare/v24.0.1...v24.0.2) (2020-09-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **no-if:** check both types of function expression ([#672](https://github.com/jest-community/eslint-plugin-jest/issues/672)) ([d462d50](https://github.com/jest-community/eslint-plugin-jest/commit/d462d50aed84ad4dc536a1f47bb7af6abd3dbe92)), closes [#670](https://github.com/jest-community/eslint-plugin-jest/issues/670)
|
|
7
|
+
|
|
1
8
|
## [24.0.1](https://github.com/jest-community/eslint-plugin-jest/compare/v24.0.0...v24.0.1) (2020-09-12)
|
|
2
9
|
|
|
3
10
|
|
package/lib/rules/no-if.js
CHANGED
|
@@ -11,7 +11,7 @@ var _utils = require("./utils");
|
|
|
11
11
|
|
|
12
12
|
const testCaseNames = new Set([...Object.keys(_utils.TestCaseName), 'it.only', 'it.concurrent.only', 'it.skip', 'it.concurrent.skip', 'test.only', 'test.concurrent.only', 'test.skip', 'test.concurrent.skip', 'fit.concurrent']);
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const isTestFunctionExpression = node => node.parent !== undefined && node.parent.type === _experimentalUtils.AST_NODE_TYPES.CallExpression && testCaseNames.has((0, _utils.getNodeName)(node.parent.callee));
|
|
15
15
|
|
|
16
16
|
const conditionName = {
|
|
17
17
|
[_experimentalUtils.AST_NODE_TYPES.ConditionalExpression]: 'conditional',
|
|
@@ -61,8 +61,8 @@ var _default = (0, _utils.createRule)({
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
|
|
64
|
-
FunctionExpression() {
|
|
65
|
-
stack.push(
|
|
64
|
+
FunctionExpression(node) {
|
|
65
|
+
stack.push(isTestFunctionExpression(node));
|
|
66
66
|
},
|
|
67
67
|
|
|
68
68
|
FunctionDeclaration(node) {
|
|
@@ -72,7 +72,7 @@ var _default = (0, _utils.createRule)({
|
|
|
72
72
|
},
|
|
73
73
|
|
|
74
74
|
ArrowFunctionExpression(node) {
|
|
75
|
-
stack.push(
|
|
75
|
+
stack.push(isTestFunctionExpression(node));
|
|
76
76
|
},
|
|
77
77
|
|
|
78
78
|
IfStatement: validate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-jest",
|
|
3
|
-
"version": "24.0.
|
|
3
|
+
"version": "24.0.2",
|
|
4
4
|
"description": "Eslint rules for Jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"@babel/core": "^7.4.4",
|
|
89
89
|
"@babel/preset-env": "^7.4.4",
|
|
90
90
|
"@babel/preset-typescript": "^7.3.3",
|
|
91
|
-
"@commitlint/cli": "^
|
|
92
|
-
"@commitlint/config-conventional": "^
|
|
91
|
+
"@commitlint/cli": "^11.0.0",
|
|
92
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
93
93
|
"@schemastore/package": "^0.0.6",
|
|
94
94
|
"@semantic-release/changelog": "^5.0.1",
|
|
95
95
|
"@semantic-release/git": "^9.0.0",
|