Bug
Cypress crashes when mocha-multi-reporters is installed locally.
Cypress cannot load the reporter when it is installed globally.
Cypress can use mocha-multi-reporters as intended.
{
"reporterEnabled": "spec, mocha-junit-reporter",
"mochaJunitReporterReporterOptions": {
"mochaFile": "multiple-results/results.xml"
}
}
{
"reporter": "mocha-multi-reporters",
"reporterOptions": {
"reporterEnabled": "spec, mocha-junit-reporter",
"mochaJunitReporterReporterOptions": {
"mochaFile": "cypress/reports/junit.xml"
}
}
}
See https://github.com/cypress-io/cypress-example-docker-circle/issues/6
In the https://github.com/cypress-io/cypress-example-docker-circle we have Cypress v1.0.2 with working multi-reporters output, what is the difference with your failing case?
When running tests from that repo, I get the same result when installed the reporter globally. But it seems to work with the reporter installed locally. I will do some extra tests to find out the differences between that project and my project where Cypress seems to crash.
I believe this has to do with the way we resolve the path. @bahmutov What he's saying is that when the reporter is installed locally it works because we resolve the node_modules relative to the projectRoot. However when installed globally this ends up being stored in a completely different place. We likely need to add the same lookup machinery that node does under the hood, instead of using manual path resolutions.
Yeah, edge case that we are not testing against
Sent from my iPhone
On Oct 19, 2017, at 13:16, Brian Mann notifications@github.com wrote:
I believe this has to do with the way we resolve the path. @bahmutov What he's saying is that when the reporter is installed locally it works because we resolve the node_modules relative to the projectRoot. However when installed globally this ends up being stored in a completely different place. We likely need to add the same lookup machinery that node does under the hood, instead of using manual path resolutions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
In the meantime, I figured out that it only crashes on a specific (failing) test. (When reporters are installed locally)
That's awesome - if you can pinpoint to specific failing test and have reproducible crash we can play with - we can fix it.
Sent from my iPhone
On Oct 20, 2017, at 08:32, Thomas Casteleyn notifications@github.com wrote:
In the meantime, I figured out that it only crashes on a specific (failing) test. (When reporters are installed locally)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
It goes well when testing:
cy.wait('@BuyRecharge').its('response.body')
Which is logical as this is not a failing test, but then when running:
cy.wait('@BuyRecharge').its('response.body').should('contain', '|pageRedirect|')
The test fails in this case (as pageRedirect is not present in the response) and lets Cypress crash.
The first line in the stack trace goes to this file mocha/lib/reporters/base.js:227 saying that test.titlePath is not a function. Which seems logically that it only happens when the test is in failures as this code is part of a function Base.list(failures)
While looking into that, I picked a very simple test with a cy.get and a tag that does not exist and the same kind of crash with same stack trace happens. See this project to reproduce: webtest.zip
Any feedback?
I have the same problem when using lerna with yarn workspace option
Most helpful comment
I have the same problem when using lerna with yarn workspace option