eslint-plugin-jest 22.4.0 → 22.4.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/index.js +12 -60
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const noTestReturnStatement = require('./rules/no-test-return-statement');
|
|
15
|
-
const preferSpyOn = require('./rules/prefer-spy-on');
|
|
16
|
-
const preferToBeNull = require('./rules/prefer-to-be-null');
|
|
17
|
-
const preferToBeUndefined = require('./rules/prefer-to-be-undefined');
|
|
18
|
-
const preferToContain = require('./rules/prefer-to-contain');
|
|
19
|
-
const preferToHaveLength = require('./rules/prefer-to-have-length');
|
|
20
|
-
const validDescribe = require('./rules/valid-describe');
|
|
21
|
-
const validExpect = require('./rules/valid-expect');
|
|
22
|
-
const preferExpectAssertions = require('./rules/prefer-expect-assertions');
|
|
23
|
-
const validExpectInPromise = require('./rules/valid-expect-in-promise');
|
|
24
|
-
const preferInlineSnapshots = require('./rules/prefer-inline-snapshots');
|
|
25
|
-
const preferStrictEqual = require('./rules/prefer-strict-equal');
|
|
26
|
-
const requireTothrowMessage = require('./rules/require-tothrow-message');
|
|
27
|
-
const noAliasMethods = require('./rules/no-alias-methods');
|
|
28
|
-
const noTestCallback = require('./rules/no-test-callback');
|
|
29
|
-
const noTruthyFalsy = require('./rules/no-truthy-falsy');
|
|
30
|
-
const preferTodo = require('./rules/prefer-todo');
|
|
31
|
-
const preferCalledWith = require('./rules/prefer-called-with');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const rules = fs
|
|
7
|
+
.readdirSync(path.join(__dirname, 'rules'))
|
|
8
|
+
.filter(rule => rule !== '__tests__' && rule !== 'util.js')
|
|
9
|
+
.map(rule => path.basename(rule, '.js'))
|
|
10
|
+
.reduce(
|
|
11
|
+
(acc, curr) => Object.assign(acc, { [curr]: require(`./rules/${curr}`) }),
|
|
12
|
+
{}
|
|
13
|
+
);
|
|
32
14
|
|
|
33
15
|
const snapshotProcessor = require('./processors/snapshot-processor');
|
|
34
16
|
|
|
@@ -88,35 +70,5 @@ module.exports = {
|
|
|
88
70
|
processors: {
|
|
89
71
|
'.snap': snapshotProcessor,
|
|
90
72
|
},
|
|
91
|
-
rules
|
|
92
|
-
'consistent-test-it': consistentTestIt,
|
|
93
|
-
'expect-expect': expectExpect,
|
|
94
|
-
'lowercase-name': lowercaseName,
|
|
95
|
-
'no-disabled-tests': noDisabledTests,
|
|
96
|
-
'no-focused-tests': noFocusedTests,
|
|
97
|
-
'no-hooks': noHooks,
|
|
98
|
-
'no-identical-title': noIdenticalTitle,
|
|
99
|
-
'no-jasmine-globals': noJasmineGlobals,
|
|
100
|
-
'no-jest-import': noJestImport,
|
|
101
|
-
'no-large-snapshots': noLargeSnapshots,
|
|
102
|
-
'no-test-prefixes': noTestPrefixes,
|
|
103
|
-
'no-test-return-statement': noTestReturnStatement,
|
|
104
|
-
'prefer-spy-on': preferSpyOn,
|
|
105
|
-
'prefer-to-be-null': preferToBeNull,
|
|
106
|
-
'prefer-to-be-undefined': preferToBeUndefined,
|
|
107
|
-
'prefer-to-contain': preferToContain,
|
|
108
|
-
'prefer-to-have-length': preferToHaveLength,
|
|
109
|
-
'valid-describe': validDescribe,
|
|
110
|
-
'valid-expect': validExpect,
|
|
111
|
-
'prefer-expect-assertions': preferExpectAssertions,
|
|
112
|
-
'valid-expect-in-promise': validExpectInPromise,
|
|
113
|
-
'prefer-inline-snapshots': preferInlineSnapshots,
|
|
114
|
-
'prefer-strict-equal': preferStrictEqual,
|
|
115
|
-
'require-tothrow-message': requireTothrowMessage,
|
|
116
|
-
'no-alias-methods': noAliasMethods,
|
|
117
|
-
'no-test-callback': noTestCallback,
|
|
118
|
-
'no-truthy-falsy': noTruthyFalsy,
|
|
119
|
-
'prefer-todo': preferTodo,
|
|
120
|
-
'prefer-called-with': preferCalledWith,
|
|
121
|
-
},
|
|
73
|
+
rules,
|
|
122
74
|
};
|