Commit 7a22968
authored
chore: comprehensive coverage, correctness, and quality improvements (#541)
Coverage: 70% → 96% lines (merged main + isolated suites)
Source fixes:
- Remove 138 lines of dead code from http-client.ts (unused retry wrappers)
- Remove 62 unnecessary c8 ignore pragmas from socket-sdk-class.ts
- Add #executeWithRetry to batchOrgPackageFetch, viewPatch, getApi, sendApi,
downloadOrgFullScanFilesAsTar, streamFullScan, postOrgTelemetry
- Fix postOrgTelemetry swallowing 5xx errors
- Fix sendApi ResponseError handling (was returning status: 0)
- Fix 6 malformed/orphaned JSDoc blocks
- Remove dead type exports (CreateOrgFullScanOptions, CreateScanFromFilepathsOptions)
Test improvements:
- Add 6 new test files covering error paths, fail paths, streaming limits,
http-client error branches, and coverage gaps (110+ new tests)
- Remove 29 duplicate tests and 2 redundant test files
- Fix cross-platform issues (hardcoded /tmp paths, timing-dependent tests)
- Fix nock/forks incompatibility in coverage mode
- Strengthen weak assertions (toBeDefined → specific values)
Coverage infrastructure:
- Fix cover.mjs aggregation: merge coverage-final.json via max-hit-count
instead of naive sum-of-totals that double-counted shared source files
- DRY cover.mjs: extract runTestSuites, mergeCoverageFinal, displayCodeCoverage
(605 → ~400 lines, eliminated --code-only duplication)
- Fix isolated test config: use singleFork: false for nock compatibility
- Update coverage thresholds to 94% lines, 83% branches, 98% functions1 parent bda639a commit 7a22968
File tree
19 files changed
+3763
-912
lines changed- .config
- scripts
- src
- test/unit
19 files changed
+3763
-912
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 3 | | |
| 4 | + | |
| 5 | + | |
8 | 6 | | |
| 7 | + | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 35 | | |
| 36 | + | |
| 37 | + | |
40 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
| 56 | + | |
58 | 57 | | |
59 | | - | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments