eslint-plugin-jest 24.5.0 → 24.5.1
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/prefer-to-be.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [24.5.1](https://github.com/jest-community/eslint-plugin-jest/compare/v24.5.0...v24.5.1) (2021-10-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **prefer-to-be:** don't consider RegExp literals as `toBe`-able ([#922](https://github.com/jest-community/eslint-plugin-jest/issues/922)) ([99b6d42](https://github.com/jest-community/eslint-plugin-jest/commit/99b6d429e697d60645b4bc64ee4ae34d7016118c))
|
|
7
|
+
|
|
1
8
|
# [24.5.0](https://github.com/jest-community/eslint-plugin-jest/compare/v24.4.3...v24.5.0) (2021-09-29)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -20,7 +20,10 @@ const isNullEqualityMatcher = matcher => isNullLiteral(getFirstArgument(matcher)
|
|
|
20
20
|
|
|
21
21
|
const isFirstArgumentIdentifier = (matcher, name) => (0, _utils.isIdentifier)(getFirstArgument(matcher), name);
|
|
22
22
|
|
|
23
|
-
const isPrimitiveLiteral = matcher =>
|
|
23
|
+
const isPrimitiveLiteral = matcher => {
|
|
24
|
+
const firstArg = getFirstArgument(matcher);
|
|
25
|
+
return firstArg.type === _experimentalUtils.AST_NODE_TYPES.Literal && !('regex' in firstArg);
|
|
26
|
+
};
|
|
24
27
|
|
|
25
28
|
const getFirstArgument = matcher => {
|
|
26
29
|
return (0, _utils.followTypeAssertionChain)(matcher.arguments[0]);
|