Closed spicemix closed 1 year ago
Hey hey @spicemix , thanks for the report!
I've not used nrwl, but I have heard of it as members of the pact community were asking for support for it too.
Do you have a sample repo you could spin up to reproduce the issue, as it will provide a good playground to provide support.
Even better if you would be keen to make a pull request!
Also I can't take credit for the majority of the code, as I only forked it to update it for later versions of mocha. The original package has been updated, and you may or may not wish to raise the issue there https://github.com/stanleyhlng/mocha-multi-reporters
Thanks @YOU54F nice response though after I filed this I had enough trouble getting all of these things working I bailed for the time being. If I get back into it I will be sure to follow-up. Monorepos are new to me as well, but are getting very popular so I probably won't be the last! It's possible to work around this in a bunch of ways.
No worries @spicemix ! I know the feeling, stuff always gets in the way.
Well free free to mash cobble together whatever you have a stick a link up and if i'm at a loose end I may take a nosey.
seconded for monorepo support, we have moved to an 18 project (and growing) solution now and are encountering this issue, workaround is to specify a relative path in the cypress config e.g.
{
// cypress.json
"reporter": "../../node_modules/cypress-multi-reporters",
"reporterOptions": {
"configFile": "reporter-config.json"
}
}
https://github.com/DKnA/cypress-junit-reporter does work in a monorepo environment so maybe that could allude to changes needed to support this?
Will be archiving this repo today, thanks for the issue raising
Code is now held here https://github.com/YOU54F/cypress-plugins/tree/master/cypress-multi-reporters
Expected behavior
Finds
cypress-multi-reporters
in any package.json/node_modules anywhere higher in the enclosing directories. Even if a package.json or node_modules is found, keep searching upwards in enclosing directories.Actual behavior
Information about the Issue
In monorepos (such as those made by
@nrwl/nx
that I am using) the tendency is to place shared dependencies in a top-levelpackage.json
so they don't have to be duplicated all over the place.cypress-multi-reporters
can't find them there, because I have a cypress folder for each app in the monorepo, now each of those needs its ownnode_modules
with redundant copies ofcypress-multi-reporters
to install and maintain for each.Steps to reproduce the behavior
cypress-multi-reporters
in the top levelpackage.json
And while I'm here allow me to strongly second the feature request of including config in the cypress.json rather than forcing CLI use. Thanks for this handy tool!