Skip to content

Configurable nyc 'relativeNycRunFromPath' parameter #160

Closed
@alastair-todd

Description

@alastair-todd

The tool has a locked opinion of where the cypress folder is in relation to the root of the project, typically:

/cypress

however we isolate cypress for e2e, thus

/e2e/cypress

so that it can have its own package.json

this means when nyc is called to generate the report it is from e2e, and not the source code root /

I've no idea the mechanics of that, but without running the command from root the report yields nothing (this is what cypress calls at test time)

C:\_dev\workspace\e2e\node_modules\.bin\nyc report --report-dir ./coverage --temp-dir C:\_dev\workspace\e2e\.nyc_output --reporter=lcov --reporter=clover --reporter=json

When manually run from C:\_dev\workspace\e2e = no report
When manually run from C:\_dev\workspace\ = report

But its the former chosen by the tool and no apparent why to effect it.

Describe the solution you'd like
A configurable relativeNycRunFromPath parameter (for me that's ..)

Describe alternatives you've considered
creating my own copy of task.js and updating process.cwd()

the change:
return execa(foundNyc, args, { cwd: join(processWorkingDirectory, '..'), stdio: 'inherit' })

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions