Commit 120e0a8
committed
feat(coverage): add c8 ignore comments for external API calls
Add coverage ignore comments to sections of code that make external
API calls, process spawns, or network requests that are difficult to
test comprehensively:
- GitHub API calls in src/github.ts (fetchGitHub, fetchGhsaDetails,
getGitHubTokenFromGitConfig)
- HTTP/HTTPS requests in src/http-request.ts (httpRequestAttempt,
httpDownloadAttempt)
- Package registry operations in src/packages/operations.ts
(extractPackage, packPackage, resolveGitHubTgzUrl)
These external calls require actual network access or process
spawning, making them unsuitable for standard unit testing. The
ignore comments ensure these integration-heavy sections don't
artificially reduce coverage metrics while maintaining test
coverage for the testable logic paths.1 parent 40cabb1 commit 120e0a8
4 files changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | | - | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
| 508 | + | |
506 | 509 | | |
507 | 510 | | |
508 | 511 | | |
| |||
515 | 518 | | |
516 | 519 | | |
517 | 520 | | |
| 521 | + | |
518 | 522 | | |
519 | 523 | | |
520 | 524 | | |
| |||
662 | 666 | | |
663 | 667 | | |
664 | 668 | | |
| 669 | + | |
665 | 670 | | |
666 | 671 | | |
667 | 672 | | |
| |||
681 | 686 | | |
682 | 687 | | |
683 | 688 | | |
| 689 | + | |
684 | 690 | | |
685 | 691 | | |
686 | 692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| 524 | + | |
524 | 525 | | |
525 | 526 | | |
526 | 527 | | |
| |||
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
| 639 | + | |
638 | 640 | | |
639 | 641 | | |
640 | 642 | | |
| |||
768 | 770 | | |
769 | 771 | | |
770 | 772 | | |
| 773 | + | |
771 | 774 | | |
772 | 775 | | |
773 | 776 | | |
| |||
858 | 861 | | |
859 | 862 | | |
860 | 863 | | |
| 864 | + | |
861 | 865 | | |
862 | 866 | | |
863 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| |||
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| 274 | + | |
272 | 275 | | |
273 | 276 | | |
274 | 277 | | |
| |||
277 | 280 | | |
278 | 281 | | |
279 | 282 | | |
| 283 | + | |
280 | 284 | | |
281 | 285 | | |
282 | 286 | | |
| |||
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
| 379 | + | |
375 | 380 | | |
376 | 381 | | |
377 | 382 | | |
| |||
399 | 404 | | |
400 | 405 | | |
401 | 406 | | |
| 407 | + | |
402 | 408 | | |
403 | 409 | | |
404 | 410 | | |
| |||
0 commit comments