Commit f72bc17
fix: handle case of invalid package.json with no explicit config (#5198)
* fix: report syntax errors in package.json (fixes: #5141)
* fix(tests): incorrect test (should use existing result)
Since `readFileSync` is only stubbed `onFirstCall` we get a different answer
the second time around which is probably Not What You Want. But also we
*already checked that config = false*. So you could just remove this
test, it does nothing useful.
* fix: separate read and parse errors
* fix: clarify invalid JSON
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
* fix(test): expect only a SyntaxError nothing else
---------
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>1 parent 68803b6 commit f72bc17
2 files changed
+54
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
184 | 185 | | |
185 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
186 | 202 | | |
187 | 203 | | |
188 | 204 | | |
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
192 | 208 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
200 | 214 | | |
201 | 215 | | |
202 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
202 | 232 | | |
203 | 233 | | |
204 | 234 | | |
| |||
287 | 317 | | |
288 | 318 | | |
289 | 319 | | |
290 | | - | |
| 320 | + | |
291 | 321 | | |
292 | 322 | | |
293 | 323 | | |
| |||
0 commit comments