-
Notifications
You must be signed in to change notification settings - Fork 120
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
Uncaught TypeError: hook.error is not a function MochaAllureReporter #482
Comments
@darkallure if you patch MochaAllureReporter on line 70 with this block of code, do you still get the error? This resolved the issue for me, and I've opened a pull request to get the changes reviewed and merged: node_modules/allure-mocha/dist/MochaAllureReporter.js line 70: onHookEnd(hook) {
console.log('inside onHookEnd...');
if(typeof hook.error === 'function')
this.coreReporter.endHook(hook.error());
else
this.coreReporter.endHook();
} |
@jamesmortensen thank you so much! It did fixed the issue but the other issue started to occur, do you know how to fix this? |
@darkallure Not sure if that's related to this change or if it's another issue altogether which needs to be reported. It does seem like the v2.0.0 platform is still missing many of the 1.0 features, so my guess is new issue. If you check the source code, do you see any implementation for label? |
@jamesmortensen Yes, I do see it: |
Can you try using the JavaScript Debug Terminal in VSCode to step through code in order to see what's missing? My guess is something is going on in the "model" that's being required. |
@jamesmortensen it cannot even pass this line: |
I'm not yet sure what runtime is supposed to be or where it comes from. It's supposed to be passed into the Allure constructor. I'm thinking it must be related to Mocha or Jest or Jasmine or whatever the runner is that's being used, but I'm not sure. Hopefully one of the maintainers of the project can jump in and give some insight. |
Fixed in 2.0.0.beta-20 via #510. Remains fixed in 3.0.0-beta.3, which uses a different approach to the parallel mode. |
Describe the bug
Getting an error when parallel mode is on while using Mocha
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The tests should run successfully in parallel mode with Mocha allure reporter
Screenshots
Additional context
the following version packages are used:
"allure-mocha": "^2.0.0-beta.19",
"mocha": "^9.2.1"
The text was updated successfully, but these errors were encountered: