eslint-plugin-jest 23.8.0 → 23.8.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
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [23.8.1](https://github.com/jest-community/eslint-plugin-jest/compare/v23.8.0...v23.8.1) (2020-02-29)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- remove tests from published package
|
|
6
|
+
([#541](https://github.com/jest-community/eslint-plugin-jest/issues/541))
|
|
7
|
+
([099a150](https://github.com/jest-community/eslint-plugin-jest/commit/099a150b87fa693ccf1c512ee501aed1457ba656))
|
|
8
|
+
|
|
1
9
|
# [23.8.0](https://github.com/jest-community/eslint-plugin-jest/compare/v23.7.0...v23.8.0) (2020-02-23)
|
|
2
10
|
|
|
3
11
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-jest",
|
|
3
|
-
"version": "23.8.
|
|
3
|
+
"version": "23.8.1",
|
|
4
4
|
"description": "Eslint rules for Jest",
|
|
5
5
|
"repository": "jest-community/eslint-plugin-jest",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"pretest": "yarn build",
|
|
34
34
|
"test": "jest",
|
|
35
35
|
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files",
|
|
36
|
-
"postbuild": "rimraf lib/**/__tests__
|
|
36
|
+
"postbuild": "rimraf lib/__tests__ lib/**/__tests__",
|
|
37
37
|
"typecheck": "tsc -p ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`rules should export configs that refer to actual rules 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"all": Object {
|
|
6
|
-
"env": Object {
|
|
7
|
-
"jest/globals": true,
|
|
8
|
-
},
|
|
9
|
-
"plugins": Array [
|
|
10
|
-
"jest",
|
|
11
|
-
],
|
|
12
|
-
"rules": Object {
|
|
13
|
-
"jest/consistent-test-it": "error",
|
|
14
|
-
"jest/expect-expect": "error",
|
|
15
|
-
"jest/lowercase-name": "error",
|
|
16
|
-
"jest/no-alias-methods": "error",
|
|
17
|
-
"jest/no-commented-out-tests": "error",
|
|
18
|
-
"jest/no-disabled-tests": "error",
|
|
19
|
-
"jest/no-duplicate-hooks": "error",
|
|
20
|
-
"jest/no-expect-resolves": "error",
|
|
21
|
-
"jest/no-export": "error",
|
|
22
|
-
"jest/no-focused-tests": "error",
|
|
23
|
-
"jest/no-hooks": "error",
|
|
24
|
-
"jest/no-identical-title": "error",
|
|
25
|
-
"jest/no-if": "error",
|
|
26
|
-
"jest/no-jasmine-globals": "error",
|
|
27
|
-
"jest/no-jest-import": "error",
|
|
28
|
-
"jest/no-large-snapshots": "error",
|
|
29
|
-
"jest/no-mocks-import": "error",
|
|
30
|
-
"jest/no-standalone-expect": "error",
|
|
31
|
-
"jest/no-test-callback": "error",
|
|
32
|
-
"jest/no-test-prefixes": "error",
|
|
33
|
-
"jest/no-test-return-statement": "error",
|
|
34
|
-
"jest/no-truthy-falsy": "error",
|
|
35
|
-
"jest/no-try-expect": "error",
|
|
36
|
-
"jest/prefer-called-with": "error",
|
|
37
|
-
"jest/prefer-expect-assertions": "error",
|
|
38
|
-
"jest/prefer-hooks-on-top": "error",
|
|
39
|
-
"jest/prefer-inline-snapshots": "error",
|
|
40
|
-
"jest/prefer-spy-on": "error",
|
|
41
|
-
"jest/prefer-strict-equal": "error",
|
|
42
|
-
"jest/prefer-to-be-null": "error",
|
|
43
|
-
"jest/prefer-to-be-undefined": "error",
|
|
44
|
-
"jest/prefer-to-contain": "error",
|
|
45
|
-
"jest/prefer-to-have-length": "error",
|
|
46
|
-
"jest/prefer-todo": "error",
|
|
47
|
-
"jest/require-to-throw-message": "error",
|
|
48
|
-
"jest/require-top-level-describe": "error",
|
|
49
|
-
"jest/valid-describe": "error",
|
|
50
|
-
"jest/valid-expect": "error",
|
|
51
|
-
"jest/valid-expect-in-promise": "error",
|
|
52
|
-
"jest/valid-title": "error",
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
"recommended": Object {
|
|
56
|
-
"env": Object {
|
|
57
|
-
"jest/globals": true,
|
|
58
|
-
},
|
|
59
|
-
"plugins": Array [
|
|
60
|
-
"jest",
|
|
61
|
-
],
|
|
62
|
-
"rules": Object {
|
|
63
|
-
"jest/expect-expect": "warn",
|
|
64
|
-
"jest/no-commented-out-tests": "warn",
|
|
65
|
-
"jest/no-disabled-tests": "warn",
|
|
66
|
-
"jest/no-export": "error",
|
|
67
|
-
"jest/no-focused-tests": "error",
|
|
68
|
-
"jest/no-identical-title": "error",
|
|
69
|
-
"jest/no-jasmine-globals": "warn",
|
|
70
|
-
"jest/no-jest-import": "error",
|
|
71
|
-
"jest/no-mocks-import": "error",
|
|
72
|
-
"jest/no-standalone-expect": "error",
|
|
73
|
-
"jest/no-test-callback": "error",
|
|
74
|
-
"jest/no-test-prefixes": "error",
|
|
75
|
-
"jest/no-try-expect": "error",
|
|
76
|
-
"jest/valid-describe": "error",
|
|
77
|
-
"jest/valid-expect": "error",
|
|
78
|
-
"jest/valid-expect-in-promise": "error",
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
"style": Object {
|
|
82
|
-
"plugins": Array [
|
|
83
|
-
"jest",
|
|
84
|
-
],
|
|
85
|
-
"rules": Object {
|
|
86
|
-
"jest/no-alias-methods": "warn",
|
|
87
|
-
"jest/prefer-to-be-null": "error",
|
|
88
|
-
"jest/prefer-to-be-undefined": "error",
|
|
89
|
-
"jest/prefer-to-contain": "error",
|
|
90
|
-
"jest/prefer-to-have-length": "error",
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
}
|
|
94
|
-
`;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _fs = require("fs");
|
|
4
|
-
|
|
5
|
-
var _path = require("path");
|
|
6
|
-
|
|
7
|
-
var _ = _interopRequireDefault(require("../"));
|
|
8
|
-
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
const ruleNames = Object.keys(_.default.rules);
|
|
12
|
-
const numberOfRules = 40;
|
|
13
|
-
describe('rules', () => {
|
|
14
|
-
it('should have a corresponding doc for each rule', () => {
|
|
15
|
-
ruleNames.forEach(rule => {
|
|
16
|
-
const docPath = (0, _path.resolve)(__dirname, '../../docs/rules', `${rule}.md`);
|
|
17
|
-
|
|
18
|
-
if (!(0, _fs.existsSync)(docPath)) {
|
|
19
|
-
throw new Error(`Could not find documentation file for rule "${rule}" in path "${docPath}"`);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
it('should have the correct amount of rules', () => {
|
|
24
|
-
const {
|
|
25
|
-
length
|
|
26
|
-
} = ruleNames;
|
|
27
|
-
|
|
28
|
-
if (length !== numberOfRules) {
|
|
29
|
-
throw new Error(`There should be exactly ${numberOfRules} rules, but there are ${length}. If you've added a new rule, please update this number.`);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
it('should export configs that refer to actual rules', () => {
|
|
33
|
-
const recommendedConfigs = _.default.configs;
|
|
34
|
-
expect(recommendedConfigs).toMatchSnapshot();
|
|
35
|
-
expect(Object.keys(recommendedConfigs)).toEqual(['all', 'recommended', 'style']);
|
|
36
|
-
expect(Object.keys(recommendedConfigs.all.rules)).toHaveLength(ruleNames.length);
|
|
37
|
-
const allConfigRules = Object.values(recommendedConfigs).map(config => Object.keys(config.rules)).reduce((previousValue, currentValue) => [...previousValue, ...currentValue]);
|
|
38
|
-
allConfigRules.forEach(rule => {
|
|
39
|
-
const ruleNamePrefix = 'jest/';
|
|
40
|
-
const ruleName = rule.slice(ruleNamePrefix.length);
|
|
41
|
-
expect(rule.startsWith(ruleNamePrefix)).toBe(true);
|
|
42
|
-
expect(ruleNames).toContain(ruleName); // eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
43
|
-
|
|
44
|
-
expect(() => require(`../rules/${ruleName}`)).not.toThrow();
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
});
|