-
Notifications
You must be signed in to change notification settings - Fork 114
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
Cannot destructure property resultsDir of opts.reporterOptions #430
Comments
It's a bug. There should be a check for npm i -D mocha-multi-reporters Then create {
"spec": "./test/**/*.spec.js",
"reporter": "mocha-multi-reporters",
"reporter-option": "configFile=reporterConfig.json"
} And change the Note that it assumes you still have |
Fixed an issue when `reporterOptions` can be missing by adding an alternative empty object, which can be correctly destructured with a default value to `resultsDir`. Fixes allure-framework#430
@jamesmortensen should be fixed now. |
Thank you! I'll see if we can now work on upgrading our allure-reporter module to the latest. :) |
I believe it's not yet published. But you can try the above suggestion. |
I can confirm now that the workaround works. The only difference is that I already had a .mocharc.js:
and then the code to run the test is like this:
I also had to make sure the reporterConfig.json was still in the root, as mentioned in previous comments:
Thank you again! |
Describe the bug
Not able to run mocha with the reporter, even for very basic tests.
To Reproduce
Steps to reproduce the behavior:
Create two files with the following contents:
test/test.spec.js:
package.json:
To replicate, first run
npm install
and then runnpm test
. You'll see the following error:Expected behavior
I have not included any allure functionality in the tests yet. I'm simply trying to run the tests, but with
--reporter allure-mocha
it is as if some option is required somewhere that isn't being set. I looked in mocha-allure2-example and found a reporterConfig.json file, and I can run those TypeScript tests, but it's not clear to me how to get it working with a simple Node.js JavaScript project. Here is the file from the example:But even if I include it, I still get the same error. What am I missing?
Desktop (please complete the following information):
Additional context
I opened up a ticket allure-framework/allure-docs#158 regarding a request for more documentation on allure-mocha. The documentation on https://docs.qameta.io/allure/#_mocha is still pointing to the deprecated mocha-allure-reporter package last updated in 2018.
The text was updated successfully, but these errors were encountered: