-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'passes' of undefined #4304
Comments
This does look like exactly like a duplicate of this issue 🤔 #3537 |
@jennifer-shehane I read that post and tried downgrading, but still does not work for me.. |
Same with me |
My fix for mocha-junit-reporter has now been merged and is available in the newly released v1.23.0 https://github.com/michaelleeallen/mocha-junit-reporter/releases/tag/v1.23.0 @jennifer-shehane as cypress uses this internally, you may wish to bump the version shipped with cypress to incorporate this change |
Well that issue is still happening for me and I'm using Cypress This is my "reporter": "mochawesome",
"reporterOptions": {
"reportDir": "artifacts/mochawesome-sources",
"quiet": true,
"overwrite": false,
"html": false,
"json": true
} It was working just fine until I upgraded dependencies this morning. These were the latest versions what worked: "mocha": Found it, the breaking change happened somewhere between mocha 5.2.0 -> 6.2.0. |
I am having the same problem here, using mocha 6.2.0, |
The same situation and downgrade to 5.2.0 didn't help... |
@zbigniewkalinowski try using these dependencies. I had same issue but resolved it with these: |
It looks like this is still an issue. Installing Cypress from scratch and adding mocha, mochawesome, mochawesome-merge, and mochawesome-report-generator, and configuring cypress.json leads to the same error, see below:
|
Mocha 6+ requires a stat collector to be instantiated which cypress doesn’t do as it use an older version of mocha internally and doesn’t use the version specified in a projects package.json. If you use cypress-multi-reporters, it will allow you to use any mocha version, and will instantiate the stats collector allowing you to use mocha 6+ in your project |
@YOU54F : thank you for your quick answer. Can you provide a little more guidance, please? I installed cypress-multi-reporters with Any suggestions? |
You want to setup your reporter in cypress json file as cypress-multi-reporters and point to a reporterOpts json file which contains the reporters you want to run. See one of my projects for an example YOU54F/template-cypress-docker-typescript#22 The master branch is running mocha 6+ and cypress |
Awesome!!! Thank you @YOU54F! For the benefit of others reading this, here is a summary of what I did. What I am trying to do is generate the log/results of the tests in a format I can distribute to humans. package.json {
"name": "cypresstest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"cypress": "^3.4.1",
"cypress-multi-reporters": "^1.2.1",
"mocha": "^6.2.1",
"mochawesome": "^4.1.0",
"mochawesome-merge": "^2.0.1",
"mochawesome-report-generator": "^4.0.1"
},
"dependencies": {}
} cypress.json {
"reporter": "cypress-multi-reporters",
"reporterOptions": {
"configFile": "reporter.json"
}
} reporter.json {
"reporterEnabled": "mochawesome",
"mochawesomeReporterOptions": {
"reportDir": "cypress/reports/mochawesome",
"overwrite": false,
"html": false,
"json": true
}
} Then I can execute my tests with
And finally I produce the HTML report with
Voila!!! |
Mocha 5.2.0 won't have this issue, only the latest Mocha 6.x and 7.x are still having this same issue... |
I'm using Mocha 7.0.1 and having this issue. |
duplicate of #3537, which has been reopened |
Current behavior:
Mochawesome does not work, getting error when I am running my tests. I have tried downgrading to V5.2(As I have seen this could solve the problem in other threads). But it does still not work.
Desired behavior:
Generated Html reports from running the tests.
Steps to reproduce: (app code and test code)
I have followed everything from the Cypress docs which lead me to this link:
http://antontelesh.github.io/testing/2019/02/04/mochawesome-merge.html
Versions
Cypress V 3.3.0
The text was updated successfully, but these errors were encountered: