Replies: 1 comment
-
Addition: With a message:
Or without the message:
The second block works as expected, but the first block (the one with the message) throws the following error:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have a global Mocha hook that runs before each spec.js. In it, I use the beforeAll hook to implement specific logic for logging into my application. Any error at this stage stops the execution of subsequent steps, which is the intended behavior. However, the spec reporter only displays errors at the {root} level without providing information about the respective spec file. This issue likely arises because the beforeAll hook is not located within any specific spec file.
Is there a way to modify the spec message to include the spec name? I'm not concerned about the details of the individual steps. I just need to include the spec name in the report.
My mocha configuration (in wdio.conf.js file):
My spec reporter configuration includes:
The mochaHooks.mjs file contains:
Currently, the output looks like:
I am seeking guidance on how to include the spec name in the error report when errors occur in the beforeAll hook.
Thank you, in advance !
Mihaela
Beta Was this translation helpful? Give feedback.
All reactions