-
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 when using custom reporter #3537
Comments
Also, I notice that mocha 6.0.0 just released 2 days ago. Can you try installing |
Thank you for quick answer. With mocha 5.2.0 it works fine, thank you.
|
Yeah, I haven't thoroughly looked through Mocha 6's changelog to see if they've made a breaking change regarding this or if this is a bug on their part. Or maybe mochaawesome needs to update their code to handle Mocha 6. 😕 |
got this error too with this following details {
"name": "coba-bos-cypress",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"cy:run": "node_modules/cypress/bin/cypress run",
"cleanup": "rm -fr mochawesome-report",
"merge_reports": "mochawesome-merge --reportDir mochawesome-report > mochawesome-report/output.json",
"generate_mochawesome_report": "marge mochawesome-report/output.json",
"e2e_mochawesome": "npm run cleanup && cypress run && npm run merge_reports && npm run generate_mochawesome_report"
},
"author": "",
"license": "ISC",
"dependencies": {
"cypress": "^3.1.5"
},
"devDependencies": {
"mocha": "^6.0.2",
"mochawesome": "^3.1.1",
"mochawesome-merge": "^1.0.7",
"mochawesome-report-generator": "^3.1.5"
}
} |
We use the mocha-junit-reporter with mocha-multi-reporters but not the mochawesome one, so this seems a problem in a BC break in mocha 6 itself. Will downgrade to 5.2 for the moment. |
Hi, I have 2 PR's tracking this upgrade to mocha 6, I use cypress & mochawesome for reporting. They have circleci runs associated with them, in case anyone wants to track the change as the other dependancies update. I haven't had a chance to look into this yet in much detail YOU54F/template-cypress-docker-typescript#15 |
Just fixed this and proposed the following 2 PR's stanleyhlng/mocha-multi-reporters#58 My branch tracking the changes, with failing builds with mocha 6 pre and post fix is here https://github.com/YOU54F/cypressio-docker-typescript/pull/15/files If you do want to move up to mocha 6, you can pull my forked branch in the interim, whilst we wait for the maintainers of the source repo to review/merge/release the PR
|
|
I've now updated, tested and released updated modules that fix this with mocha 6, but also retains backwards compatibility with mocha 5 and earlier versions. (tested with mocha 6.0.0 / latest and 5.2.0) https://www.npmjs.com/package/cypress-multi-reporters Example against Mocha 5 the changes required are minimal
in reporterOpts.json {
"reporterEnabled": "mocha-junit-reporters, mochawesome",
"mochaJunitReportersReporterOptions": {
"mochaFile": "cypress/reports/junit/test_results[hash].xml",
"toConsole": false
},
"mochawesomeReporterOptions": {
"reportDir": "cypress/reports/mocha",
"quiet": true,
"overwrite": false,
"html": false,
"json": true
}
} in cypress.json {
...
"reporter": "cypress-multi-reporters",
"reporterOptions": {
"configFile": "reporterOpts.json"
} See https://github.com/YOU54F/cypress-docker-typescript/pull/22/files for this fix applied, I have teste Hopefully the PR's will be merged in the source repo's soon but for now, enjoy |
This issue still happens in latest version 3.3.0 as well ! |
@executeautomation It's not an issue in Cypress, it was a breaking change in Mocha, I fixed it and have just performed a run with
|
Wow thats cool @YOU54F , great to fix the issue and hopefully it will be fixed in cypress-multi-reporters and mocha-junit-reporters as well. Thanks, |
Closing since this is an external issue. |
@YOU54F we were using this setup:
But your repository |
|
@jennifer-shehane sorry for the misunderstanding. I tried to highlight @YOU54F's name, it was a question to him on behalf of the cypress community using moche multi reporters 🤓 I think he renamed the package from |
Hey chap Apologies, I deleted the fork and released it as https://github.com/YOU54F/cypress-multi-reporters as the main repository isn’t being maintained They are both published to npm with updated dependencies
|
@YOU54F awesome, great work and fast response 🔥 We just confirmed that it works. Thanks for making the world a better place 🙌 |
Working properly with this combination:
|
Mocha 5.2.0 won't have this issue, only the latest Mocha 6.x and 7.x are still having this same issue... |
am getting below error, |
reopening since this is a problem we can potentially fix, we shouldn't require users to install a specific mocha version |
The code for this is done in cypress-io/cypress#6951, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
After running cypress with
--reporter mochawesome
I'm getting exception:Desired behavior:
Report is generated
Steps to reproduce: (app code and test code)
Set up according to documentation
Versions
The text was updated successfully, but these errors were encountered: