code-coverage: Doesn't work with non-root project folder on Windows
First of all, really awesome initiative with this plugin.
My cypress test suite is inside a test folder.
With this plugin, my specs fail with the following message:
CypressError: cy.task('coverageReport') failed with the following error:
> Error: Command failed: nyc report --reporter=html
at makeError (/Users/xxx/projectname/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/Users/xxx/projectname/node_modules/execa/index.js:278:16)
at <anonymous>
Moving the cypress folder and cypress.json to the root of the project, outside of /test, makes the whole thing work again.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 18 (6 by maintainers)
I’ve the same issue, but I can’t fix it like @ericorruption suggested, because my client (
gui) and server (backend) are seperate repositories and there is currently no way into merging them.The error I get in the
after allsection:My guess is that
nycgets executed in the folder wherecypress.jsonresides and therfore hasn’t direct access to the source files. Running thenyc reportcommand in a shell doesn’t fail, but ignores the missing source files, so I don’t know if that is really the problem…A little off-topic: The last line in the error message is a little missleading. It looks like it is a generic error for all hooks (
before,beforeEach,afterEach,after), but it doesn’t make much sense that after theafterhook the remaining tests are skipped, because there never won’t be any tests remaining.Hmm @jrnail23 this seems like a separate issue from the original (
nyclocation). Please open a new issue with folder structure described in enough detail so I can understand it - or better a public repo available that shows the problemEDIT: in my case, nyc had been accidentally removed, so this can be a cause - it actually wasn’t there 😃
The same issue happens with yarn workspaces, where nyc is installed in a higher folder.
This is on Mac OS X