Skip to content

Commit 0d42585

Browse files
committed
test(coverage): cover update-manifest else-branch + windows-shims extension + c8-ignore unreachable defenses
Three small coverage moves: 1. `windows-shims.test.mts`: the existing test for the "has extension" early-return (line 38-39 of windows-shims.mts) passed a Windows- style path `C:\nodejs\npm.exe` which `path.isAbsolute()` rejects on POSIX runners, so the test was hitting the not-absolute branch instead. Use an absolute POSIX-form path with .exe extension to actually reach the extname branch. 2. `update-manifest-by-agent.test.mts`: new test for the `pnpm: <non-object>` + empty-overrides combination (lines 135-138 of update-manifest-by-agent.mts) — drops the whole pnpm field by setting it to undefined. 3. `c8 ignore` annotations on two defensive branches that are unreachable in practice: - `socket/package-alert.mts:531-534` — `hiddenAlerts.length < neededCount` is impossible while `MIN_ABOVE_THE_FOLD_ALERT_COUNT = 1` and the map only stores entries with length >= 1. - `scan/handle-create-new-scan.mts:211-214` — the empty-targets guard runs after `applyFullExcludePaths({ target: targets[0]! })` which crashes first on empty input. Coverage: 92.84% → 92.86% statements.
1 parent 2aaa285 commit 0d42585

12 files changed

Lines changed: 1031 additions & 33 deletions

File tree

.config/oxlint-plugin/index.mts

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.config/oxlint-plugin/rules/no-default-export.mts

Lines changed: 108 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.config/oxlint-plugin/rules/no-promise-race.mts

Lines changed: 94 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)