question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work with non-root project folder on Windows

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
schl3ckcommented, Aug 1, 2019

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 all section:

CypressError: cy.task('coverageReport') failed with the following error:

> Error: spawn nyc ENOENT
    at notFoundError (C:\Users\xxx\projectname\gui\node_modules\cross-spawn\lib\enoent.js:6:26)
    at verifyENOENT (C:\Users\xxx\projectname\gui\node_modules\cross-spawn\lib\enoent.js:40:16)
    at ChildProcess.cp.emit (C:\Users\xxx\projectname\gui\node_modules\cross-spawn\lib\enoent.js:27:25)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

Because this error occurred during a 'after all' hook we are skipping all of the remaining tests.

My guess is that nyc gets executed in the folder where cypress.json resides and therfore hasn’t direct access to the source files. Running the nyc report command 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 the after hook the remaining tests are skipped, because there never won’t be any tests remaining.

1reaction
bahmutovcommented, Mar 13, 2020

Hmm @jrnail23 this seems like a separate issue from the original (nyc location). 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 problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't create folder or files in root directory of USB drive.
Can't create folder or files in root directory of USB drive. This seems to be a permissions problem, but I can't find what's...
Read more >
How to fix a eclipse project that was shared without the root ...
You need to open Windows Explorer to manually create the new folder under the component root folder of the sandbox. Then switch back...
Read more >
root folder equivalent in windows
In Windows it's relative to what drive your current working directory is at the time. If your current directory is in the C...
Read more >
Multi-root Workspaces in Visual Studio Code
You can open and work on multiple project folders in Visual Studio Code with multi-root workspaces.
Read more >
What Is a Root Folder or Root Directory?
ROOT is also an acronym for ROOT's Object Oriented Technologies, but it has nothing to do with root folders. Examples of Root Folders....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found