Commit 6192bad
committed
fix(coverage): alias @loopover/contract to source so patch coverage attributes correctly
@loopover/contract is consumed via its package specifier everywhere, which
resolves through node_modules' exports map straight to compiled dist/*.js --
unlike packages/loopover-mcp/miner's RELATIVE ../lib/foo.js imports, which fall
back to a sibling .ts when nothing exists at the .js path. A package-specifier
resolution that already finds a real compiled file has no such fallback, so v8
instrumented dist/ (gitignored, invisible to Codecov) instead of
packages/loopover-contract/src/**/*.ts. Confirmed live: #9530 reported 0% patch
coverage on fully-tested contract source.
Aliased both import specifiers straight to source. The /tools subpath alias has
to be declared BEFORE the bare @loopover/contract entry: Vite's string-find
alias matcher treats a plain string as matching both the exact specifier and
anything starting with find + "/", first-match-wins in declaration order --
with the bare entry first it silently intercepted the /tools import too and
rewrote it to a bogus path, breaking resolution outright. Found by reproducing
the failure with a throwaway probe test before reordering, not assumed.
Verified: a scoped coverage run against contract-registry.test.ts + the pilot
tool tests now shows 100% statement/branch/function/line coverage on the
contract package, where before the alias it was flat 0%.1 parent d837d1a commit 6192bad
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
13 | 32 | | |
14 | 33 | | |
15 | 34 | | |
| |||
0 commit comments