-
Notifications
You must be signed in to change notification settings - Fork 2
/
pre-commit.js.snap
123 lines (104 loc) · 4.19 KB
/
pre-commit.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
121
122
123
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`pre-commit calls lint-staged CLI with default args 1`] = `
Array [
lint-staged --config ./src/config/lintstagedrc.js,
npm run validate,
]
`;
exports[`pre-commit disables DocToc and forwards args 1`] = `
Array [
lint-staged --config .test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json --verbose --some-other-arg,
npm run validate,
]
`;
exports[`pre-commit disables DocToc and forwards args 2`] = `
Array [
.test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
{"*.+(js|jsx|json|json5|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx|vue)":["./src/index.js format"],"*.+(js|jsx|ts|tsx)":["./src/index.js lint"],"*.+(tsx|ts|jsx|js)":["./src/index.js test --findRelatedTests --passWithNoTests"]},
]
`;
exports[`pre-commit disables DocToc, overrides built-in test command, and forwards args 1`] = `
Array [
lint-staged --config .test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json --verbose --some-other-arg,
npm run validate,
]
`;
exports[`pre-commit disables DocToc, overrides built-in test command, and forwards args 2`] = `
Array [
.test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
{"*.+(js|jsx|json|json5|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx|vue)":["./src/index.js format"],"*.+(js|jsx|ts|tsx)":["./src/index.js lint"],"*.+(tsx|ts|jsx|js)":["yarn test:custom --findRelatedTests foo.js"]},
]
`;
exports[`pre-commit does not run validate script if it's not defined 1`] = `
Array [
lint-staged --config ./src/config/lintstagedrc.js,
]
`;
exports[`pre-commit does not use built-in config with .lintstagedrc file 1`] = `
Array [
lint-staged ,
npm run validate,
]
`;
exports[`pre-commit does not use built-in config with --config 1`] = `
Array [
lint-staged --config ./custom-config.js,
npm run validate,
]
`;
exports[`pre-commit does not use built-in config with lint-staged pkg prop 1`] = `
Array [
lint-staged ,
npm run validate,
]
`;
exports[`pre-commit does not use built-in config with lint-staged.config.js file 1`] = `
Array [
lint-staged ,
npm run validate,
]
`;
exports[`pre-commit forwards args 1`] = `
Array [
lint-staged --config ./src/config/lintstagedrc.js --verbose,
npm run validate,
]
`;
exports[`pre-commit overrides built-in test command with --test-command 1`] = `
Array [
lint-staged --config .test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
npm run validate,
]
`;
exports[`pre-commit overrides built-in test command with --test-command 2`] = `
Array [
.test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
{"README.md":["doctoc --maxlevel 4 --notitle"],"*.+(js|jsx|json|json5|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx|vue)":["./src/index.js format"],"*.+(js|jsx|ts|tsx)":["./src/index.js lint"],"*.+(tsx|ts|jsx|js)":["yarn test:custom --findRelatedTests foo.js"]},
]
`;
exports[`pre-commit overrides built-in test command with --test-command and forwards args 1`] = `
Array [
lint-staged --config .test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json --verbose,
npm run validate,
]
`;
exports[`pre-commit overrides built-in test command with --test-command and forwards args 2`] = `
Array [
.test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
{"README.md":["doctoc --maxlevel 4 --notitle"],"*.+(js|jsx|json|json5|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx|vue)":["./src/index.js format"],"*.+(js|jsx|ts|tsx)":["./src/index.js lint"],"*.+(tsx|ts|jsx|js)":["yarn test:custom --findRelatedTests foo.js"]},
]
`;
exports[`pre-commit overrides built-in test command with --testCommand 1`] = `
Array [
lint-staged --config .test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json,
npm run validate,
]
`;
exports[`pre-commit overrides built-in test command with --testCommand and forwards args 1`] = `
Array [
lint-staged --config .test-tmp/hover-javascriptTMPSUFFIX/.lintstaged.json --verbose,
npm run validate,
]
`;
exports[`pre-commit throws an error when \`--config\` and \`--testCommand\` are used together 1`] = `[Error: @hover/javascript/pre-commit: --config and --testCommand cannot be used together (--testCommand only works with built-in lint-staged configuration)]`;
exports[`pre-commit throws an error when invalid \`--testCommand\` is provided 1`] = `[Error: @hover/javascript/pre-commit: invalid --testCommand]`;