Closed Vitalii4as closed 9 months ago
@Vitalii4as I'm not going to debug this one for you, it is your custom reporter. Find out where your reporter crashes, which property/variable is undefined. Then let's see what we evtl. can do for you.
It does not crash in the reporter, it crashes inside nodejs internals:
TypeError: Cannot read property 'length' of undefined
at processTicksAndRejections (internal/process/task_queues.js:95:5)
This is probably because I'm running the same reporter for workers.
runner.workerReporter(`${__dirname}/json-reporter.js`);
Then probably you should try this way: #4403
I believe this is a user question where the best help given was to point to a PR with lots of debugging advice. Someone please yell at me if I'm wrong and there's actually a fix to be made to Mocha. 🙂
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
Getting error when trying to run tests in parallel mode with custom reporters
Steps to Reproduce
Expected behavior: Test executed without errors Actual behavior: TypeError: Cannot read property 'length' of undefined
Reproduces how often: 100%
Versions
Additional Information
Custom reporter code