error.name missing when errors are serialized when running tests in parallel - Causes test results to be incorrectly reported in allure-mocha #4994
Labels
stale
this has been inactive for a while...
status: waiting for author
waiting on response from OP - more information needed
Prerequisites
faq
labelnode_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
Some reporters use the type of error to determine how to treat a test that fails. Allure is one example. If a test fails due to an AssertionError, then the test is marked in red, as failed. All other errors are treated as broken tests. These results are marked in yellow, as broken.
When running mocha in parallel, the error objects are serialized and then later deserialized. During the serialization process, we are preserving the
error.message
but not theerror.name
. Because of this, it's impossible for Allure to determine the type of error by using the error.name property.Steps to Reproduce
To Reproduce
Steps to reproduce the behavior:
The example has us run tests in sequential mode as well as parallel mode. The README also has screenshots which show the issue.
Expected behavior
Actual behavior
Screenshots
Reproduces how often:
Reproduces 100% of the time.
Versions
mocha --version
andnode_modules/.bin/mocha --version
: 10.2.0node --version
: 18.3.0Additional information:
Issue originally reported here: allure-framework/allure-js#485 but I traced the root cause to Mocha.
The text was updated successfully, but these errors were encountered: