eslint-plugin-jest-dom 5.8.1 → 5.9.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/README.md +1 -3
- package/dist/rules/prefer-to-have-class.js +2 -2
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -106,9 +106,7 @@ To enable this configuration with `eslint.config.js`, use
|
|
|
106
106
|
```javascript
|
|
107
107
|
module.exports = [
|
|
108
108
|
{
|
|
109
|
-
files: [
|
|
110
|
-
/* glob matching your test files */
|
|
111
|
-
],
|
|
109
|
+
files: [/* glob matching your test files */],
|
|
112
110
|
...require("eslint-plugin-jest-dom").configs["flat/recommended"],
|
|
113
111
|
},
|
|
114
112
|
];
|
|
@@ -28,13 +28,13 @@ const meta = exports.meta = {
|
|
|
28
28
|
};
|
|
29
29
|
const create = context => ({
|
|
30
30
|
//expect(el.classList.contains("foo")).toBe(true)
|
|
31
|
-
[`CallExpression[callee.object.callee.name=expect][callee.object.arguments.0.callee.object.property.name=classList][callee.object.arguments.0.callee.property.name=contains][callee.property.name=/toBe(
|
|
31
|
+
[`CallExpression[callee.object.callee.name=expect][callee.object.arguments.0.callee.object.property.name=classList][callee.object.arguments.0.callee.property.name=contains][callee.property.name=/toBe(Tru(e|thy)|Fals(e|y))?|to(Strict)?Equal/]`](node) {
|
|
32
32
|
const classValue = node.callee.object.arguments[0].arguments[0];
|
|
33
33
|
const checkedProp = node.callee.object.arguments[0].callee.object.object;
|
|
34
34
|
const matcher = node.callee.property;
|
|
35
35
|
const [matcherArg] = node.arguments;
|
|
36
36
|
const [expectArg] = node.callee.object.arguments;
|
|
37
|
-
const isTruthy = matcher.name === "toBe" && matcherArg.value === true || matcher.name === "toBeTruthy";
|
|
37
|
+
const isTruthy = matcher.name === "toBe" && matcherArg.value === true || matcher.name === "toBeTruthy" || matcher.name === "toBeTrue";
|
|
38
38
|
context.report({
|
|
39
39
|
node: matcher,
|
|
40
40
|
messageId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-jest-dom",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.1",
|
|
4
4
|
"description": "ESLint plugin to follow best practices and anticipate common mistakes when writing tests with jest-dom",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -33,14 +33,13 @@
|
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "babel src --out-dir dist --delete-dir-on-start --copy-files --no-copy-ignored",
|
|
35
35
|
"regenerate-docs": "npm run build && eslint-doc-generator",
|
|
36
|
-
"lint": "
|
|
36
|
+
"lint": "eslint .",
|
|
37
37
|
"setup": "npm install",
|
|
38
38
|
"test": "jest",
|
|
39
39
|
"test:coverage": "npm test -- --coverage",
|
|
40
40
|
"test:update": "npm test:coverage -- --updateSnapshot"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@babel/runtime": "^7.16.3",
|
|
44
43
|
"requireindex": "^1.2.0"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
@@ -49,15 +48,15 @@
|
|
|
49
48
|
"@testing-library/dom": "^10.4.1",
|
|
50
49
|
"@typescript-eslint/parser": "^5.9.1",
|
|
51
50
|
"eslint": "^8.7.0",
|
|
51
|
+
"eslint-config-prettier": "^8.10.2",
|
|
52
52
|
"eslint-doc-generator": "^3.0.0",
|
|
53
|
-
"eslint-plugin-
|
|
53
|
+
"eslint-plugin-import": "^2.32.0",
|
|
54
|
+
"eslint-plugin-jest": "^29.16.0",
|
|
54
55
|
"eslint-remote-tester": "^3.0.0",
|
|
55
56
|
"eslint-remote-tester-repositories": "^1.0.1",
|
|
56
57
|
"jest": "^28.1.3",
|
|
57
|
-
"jest-serializer-path": "^0.1.15",
|
|
58
58
|
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
59
|
-
"
|
|
60
|
-
"prettier": "^2.0.0",
|
|
59
|
+
"prettier": "^3.9.6",
|
|
61
60
|
"semver": "^7.6.0",
|
|
62
61
|
"typescript": "^5.1.3"
|
|
63
62
|
},
|