c8rc extends attribute with relative path not working as expected
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Version: v18.18.0
Platform: WIn 11 22H2
c8 Version: 8.0.1
I think I found a bug with c8rc using cascaded c8rc configurations. I figured out I could use the "extends" attribute in the .c8rc config to merge configs. I want to merge configs because we use c8 in a monorepo structure.
It seems that the relative path is resolved based on the working directory of the call instead of the file location of .c8rc.json file. I have build a small demo repository here:
https://github.com/dawsonp-zwickroell/c8rc-extends-problem
Steps to reproduce:
- Checkout
- yarn install
- Change workdir to libs/sub-libs/lib1
- Run `yarn run coverage`
The output on the terminal produces the following error:
ENOENT: no such file or directory, open 'C:\dev\c8rc-extends-problem\libs\.c8rc.json'
I suppose this happens because the value of extends is "../../.c8rc.json" but is not evaluated from "libs/sub-libs" but from "libs/sub-libs/lib1"
Contributor guide
Assessment
This issue has not been assessed yet.