/
getConfig.spec.js.snap
120 lines (91 loc) Β· 3.1 KB
/
getConfig.spec.js.snap
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getConfig should return config with defaults 1`] = `
Object {
"chunkSize": 9007199254740991,
"concurrent": true,
"globOptions": Object {
"dot": true,
"matchBase": true,
},
"ignore": Array [],
"linters": Object {},
"relative": false,
"renderer": "update",
"subTaskConcurrency": 1,
}
`;
exports[`getConfig should return config with defaults for undefined 1`] = `
Object {
"chunkSize": 9007199254740991,
"concurrent": true,
"globOptions": Object {
"dot": true,
"matchBase": true,
},
"ignore": Array [],
"linters": Object {},
"relative": false,
"renderer": "update",
"subTaskConcurrency": 1,
}
`;
exports[`getConfig should set linters 1`] = `
Object {
"chunkSize": 9007199254740991,
"concurrent": true,
"globOptions": Object {
"dot": true,
"matchBase": true,
},
"ignore": Array [],
"linters": Object {
"*.js": Array [
"eslint --fix",
"git add",
],
".*rc": "jsonlint",
},
"relative": false,
"renderer": "update",
"subTaskConcurrency": 1,
}
`;
exports[`validateConfig should not throw and should print nothing for advanced valid config 1`] = `""`;
exports[`validateConfig should not throw and should print nothing for custom renderer 1`] = `""`;
exports[`validateConfig should not throw and should print nothing for simple valid config 1`] = `""`;
exports[`validateConfig should not throw and should print validation warnings for mixed config 1`] = `
"
WARN β Validation Warning:
Unknown option \\"*.js\\" with value ['eslint --fix', 'git add'] was found in the config root.
You are probably trying to mix simple and advanced config formats. Adding
\\"linters\\": {
\\"*.js\\": [\\"eslint --fix\\",\\"git add\\"]
}
will fix it and remove this message.
Please refer to https://github.com/okonet/lint-staged#configuration for more information..."
`;
exports[`validateConfig should print deprecation warning for deprecated options 1`] = `
"
WARN β Deprecation Warning:
Option gitDir was removed.
lint-staged now automatically resolves '.git' directory.
Please remove gitDir from your configuration.
Please refer to https://github.com/okonet/lint-staged#configuration for more information...
WARN β Deprecation Warning:
Option verbose was removed.
Use the command line flag --debug instead.
Please remove verbose from your configuration.
Please refer to https://github.com/okonet/lint-staged#configuration for more information..."
`;
exports[`validateConfig should throw and should print validation errors for invalid config 1`] = `
"β Validation Error:
chunkSize must be a \`number\` type, but the final value was: \`\\"string\\"\`.
Please refer to https://github.com/okonet/lint-staged#configuration for more information..."
`;
exports[`validateConfig should throw and should print validation errors for invalid linter config 1`] = `
"β Validation Error:
Invalid value for 'linters[*.js]'.
Should be a string or an array of strings.
Configured value is: '*.js'
Please refer to https://github.com/okonet/lint-staged#configuration for more information..."
`;