This repository has been archived by the owner on Jul 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.js
81 lines (73 loc) · 2.21 KB
/
testing.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const OFF = 0,
WARN = 1,
ERROR = 2
const JEST_RULES = {
// https://www.npmjs.com/package/eslint-plugin-jest#rules
'jest/expect-expect': OFF,
'jest/lowercase-name': OFF,
'jest/no-commented-out-tests': OFF,
'jest/no-duplicate-hooks': OFF,
'jest/no-empty-title': OFF,
'jest/no-expect-resolves': OFF,
'jest/no-export': OFF,
'jest/no-hooks': OFF,
'jest/no-identical-title': OFF,
'jest/no-if': OFF,
'jest/no-jest-import': OFF,
'jest/no-large-snapshots': OFF,
'jest/no-mocks-import': OFF,
'jest/no-standalone-expect': OFF,
'jest/no-test-callback': OFF,
'jest/no-test-prefixes': OFF,
'jest/no-truthy-falsy': OFF,
'jest/no-try-expect': OFF,
'jest/prefer-called-with': OFF,
'jest/prefer-expect-assertions': OFF,
'jest/prefer-inline-snapshots': OFF,
'jest/prefer-spy-on': OFF,
'jest/prefer-strict-equal': OFF,
'jest/prefer-todo': OFF,
'jest/require-top-level-describe': OFF,
'jest/require-tothrow-message': OFF,
'jest/no-alias-methods': WARN,
'jest/no-disabled-tests': WARN,
'jest/consistent-test-it': [ERROR, { 'fn': 'it', 'withinDescribe': 'it' }],
'jest/no-focused-tests': ERROR,
'jest/no-jasmine-globals': ERROR,
'jest/no-test-return-statement': OFF,
'jest/prefer-to-be-null': ERROR,
'jest/prefer-to-be-undefined': ERROR,
'jest/prefer-to-contain': ERROR,
'jest/prefer-to-have-length': ERROR,
'jest/valid-describe': ERROR,
'jest/valid-expect': ERROR,
'jest/valid-expect-in-promise': OFF,
}
const JEST_FORMATTING_RULES = {
// https://github.com/dangreenisrael/eslint-plugin-jest-formatting#rule-documentation
'jest-formatting/padding-around-after-all-blocks': ERROR,
'jest-formatting/padding-around-after-each-blocks': ERROR,
'jest-formatting/padding-around-before-all-blocks': ERROR,
'jest-formatting/padding-around-before-each-blocks': ERROR,
'jest-formatting/padding-around-expect-groups': ERROR,
'jest-formatting/padding-around-describe-blocks': ERROR,
'jest-formatting/padding-around-test-blocks': ERROR
}
module.exports = {
env: {
'jest/globals': true
},
plugins: [
'jest',
'jest-formatting'
],
rules: {
...JEST_RULES,
...JEST_FORMATTING_RULES
},
'settings': {
'react': {
'version': 'detect'
}
}
}