Commit d0d8c10
authored
fix(rees): run REES coverage's test child from review-enrichment/ (#8616)
spawnSync ran c8 and the node:test child it wraps with the same cwd
(the monorepo root), needed so c8's lcov SF: paths remap to
review-enrichment/src/** for Codecov. But that left the actual test
process running from the wrong directory, so tests that read fixtures
via bare relative paths (e.g. analyzer-metadata.test.ts reading
"analyzer-metadata.json") failed with ENOENT even though the fixture
exists at review-enrichment/analyzer-metadata.json.
Preload a small --require script into only the spawned test child to
chdir it into review-enrichment/ before node:test loads any files,
leaving c8's own process cwd (and therefore its SF: path remapping)
untouched. Test file arguments switch from root-relative to absolute
paths since they're now resolved from a different cwd.1 parent e56e9a7 commit d0d8c10
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
0 commit comments