eslint-plugin-jest 23.13.1 → 23.13.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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [23.13.2](https://github.com/jest-community/eslint-plugin-jest/compare/v23.13.1...v23.13.2) (2020-05-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add `fail` to globals ([#595](https://github.com/jest-community/eslint-plugin-jest/issues/595)) ([aadc5ec](https://github.com/jest-community/eslint-plugin-jest/commit/aadc5ec5610ec024eac4b0aa6077cc012a0ba98e))
|
|
7
|
+
|
|
1
8
|
## [23.13.1](https://github.com/jest-community/eslint-plugin-jest/compare/v23.13.0...v23.13.1) (2020-05-17)
|
|
2
9
|
|
|
3
10
|
|
package/lib/globals.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -35,7 +35,7 @@ const excludedFiles = ['__tests__', 'utils'];
|
|
|
35
35
|
const rules = (0, _fs.readdirSync)(rulesDir).map(rule => (0, _path.parse)(rule).name).filter(rule => !excludedFiles.includes(rule)).reduce((acc, curr) => Object.assign(acc, {
|
|
36
36
|
[curr]: importDefault((0, _path.join)(rulesDir, curr))
|
|
37
37
|
}), {});
|
|
38
|
-
const allRules = Object.keys(rules).reduce((rules, key) => _objectSpread({}, rules, {
|
|
38
|
+
const allRules = Object.keys(rules).reduce((rules, key) => _objectSpread(_objectSpread({}, rules), {}, {
|
|
39
39
|
[`jest/${key}`]: 'error'
|
|
40
40
|
}), {});
|
|
41
41
|
module.exports = {
|
|
@@ -66,16 +66,16 @@ var _default = (0, _utils.createRule)({
|
|
|
66
66
|
|
|
67
67
|
const jestVersion = ((_ref = context.settings) === null || _ref === void 0 ? void 0 : (_ref$jest = _ref.jest) === null || _ref$jest === void 0 ? void 0 : _ref$jest.version) || detectJestVersion();
|
|
68
68
|
|
|
69
|
-
const deprecations = _objectSpread({}, jestVersion >= 15 && {
|
|
69
|
+
const deprecations = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, jestVersion >= 15 && {
|
|
70
70
|
'jest.resetModuleRegistry': 'jest.resetModules'
|
|
71
|
-
},
|
|
71
|
+
}), jestVersion >= 17 && {
|
|
72
72
|
'jest.addMatchers': 'expect.extend'
|
|
73
|
-
},
|
|
73
|
+
}), jestVersion >= 21 && {
|
|
74
74
|
'require.requireMock': 'jest.requireMock',
|
|
75
75
|
'require.requireActual': 'jest.requireActual'
|
|
76
|
-
},
|
|
76
|
+
}), jestVersion >= 22 && {
|
|
77
77
|
'jest.runTimersToTime': 'jest.advanceTimersByTime'
|
|
78
|
-
},
|
|
78
|
+
}), jestVersion >= 26 && {
|
|
79
79
|
'jest.genMockFromModule': 'jest.createMockFromModule'
|
|
80
80
|
});
|
|
81
81
|
|
|
@@ -110,7 +110,7 @@ var _default = (0, _utils.createRule)({
|
|
|
110
110
|
if ('property' in node.callee && ((0, _utils.isSupportedAccessor)(node.callee.property, 'toMatchInlineSnapshot') || (0, _utils.isSupportedAccessor)(node.callee.property, 'toThrowErrorMatchingInlineSnapshot'))) {
|
|
111
111
|
var _options$inlineMaxSiz;
|
|
112
112
|
|
|
113
|
-
reportOnViolation(context, node, _objectSpread({}, options, {
|
|
113
|
+
reportOnViolation(context, node, _objectSpread(_objectSpread({}, options), {}, {
|
|
114
114
|
maxSize: (_options$inlineMaxSiz = options.inlineMaxSize) !== null && _options$inlineMaxSiz !== void 0 ? _options$inlineMaxSiz : options.maxSize
|
|
115
115
|
}));
|
|
116
116
|
}
|
package/lib/rules/utils.js
CHANGED
|
@@ -231,7 +231,7 @@ const parseExpectMember = expectMember => ({
|
|
|
231
231
|
node: expectMember
|
|
232
232
|
});
|
|
233
233
|
|
|
234
|
-
const reparseAsMatcher = parsedMember => _objectSpread({}, parsedMember, {
|
|
234
|
+
const reparseAsMatcher = parsedMember => _objectSpread(_objectSpread({}, parsedMember), {}, {
|
|
235
235
|
/**
|
|
236
236
|
* The arguments being passed to this `Matcher`, if any.
|
|
237
237
|
*
|
|
@@ -265,7 +265,7 @@ const reparseMemberAsModifier = parsedMember => {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
const negation = parsedMember.node.parent && isExpectMember(parsedMember.node.parent, ModifierName.not) ? parsedMember.node.parent : undefined;
|
|
268
|
-
return _objectSpread({}, parsedMember, {
|
|
268
|
+
return _objectSpread(_objectSpread({}, parsedMember), {}, {
|
|
269
269
|
negation
|
|
270
270
|
});
|
|
271
271
|
};
|