You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am using mocha-multi-reporters in my mocha tests and generating mochawesome and mocha-junit-reports. When using --parallel flag, mocha-junit-reporter throws error:
Uncaught error outside test suite:
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at isInvalidSuite (node_modules/mocha-junit-reporter/index.js:155:62)
at MochaJUnitReporter._onSuiteBegin (node_modules/mocha-junit-reporter/index.js:232:10)
at MochaJUnitReporter. (node_modules/mocha-junit-reporter/index.js:239:17)
at ParallelBufferedRunner.emit (node:events:530:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.allSettled (index 0)
I'm trying to run tests in parallel as well and getting the a similar issue:
C:\Users\jsmith\git\myProject\node_modules\mocha-junit-reporter\index.js:217
return testsuites[testsuites.length - 1].testsuite;
^
TypeError: Cannot read properties of undefined (reading 'testsuite')
at lastSuite (C:\Users\jsmith\git\myProject\node_modules\mocha-junit-reporter\index.js:217:46)
at MochaJUnitReporter. (C:\Users\jsmith\git\myProject\node_modules\mocha-junit-reporter\index.js:262:5)
at ParallelBufferedRunner.emit (node:events:531:35)
at ParallelBufferedRunner.emit (node:domain:488:12)
at ParallelBufferedRunner.Runner.fail (C:\Users\jsmith\git\myProject\node_modules\mocha\lib\runner.js:464:8)
at ParallelBufferedRunner.Runner._uncaught (C:\Users\jsmith\git\myProject\node_modules\mocha\lib\runner.js:994:12)
at C:\Users\jsmith\git\myProject\node_modules\mocha\lib\nodejs\parallel-buffered-runner.js:340:18
at Array.forEach ()
at C:\Users\jsmith\git\myProject\node_modules\mocha\lib\nodejs\parallel-buffered-runner.js:333:12
at processTicksAndRejections (node:internal/process/task_queues:95:5)
I followed the documentation and set up my mocha config as follows:
I tried updating my mocha config and changing the name to something random but the debugger always shows the mochaFile as 'test-results.xml'. I don't know that this is the issue but this is what I found.
I'm completely blocked. Has anyone figured this out?
i am using mocha-multi-reporters in my mocha tests and generating mochawesome and mocha-junit-reports. When using --parallel flag, mocha-junit-reporter throws error:
Uncaught error outside test suite:
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at isInvalidSuite (node_modules/mocha-junit-reporter/index.js:155:62)
at MochaJUnitReporter._onSuiteBegin (node_modules/mocha-junit-reporter/index.js:232:10)
at MochaJUnitReporter. (node_modules/mocha-junit-reporter/index.js:239:17)
at ParallelBufferedRunner.emit (node:events:530:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.allSettled (index 0)
command used to run the tests is:
./node_modules/mocha/bin/mocha.js --config .mocharc.cjs --parallel --reporter mocha-multi-reporters --reporter-options configFile=reporter-config.json --require mochawesome/register --exit test/**/*.spec.js
below is the reporter config file:
{
"reporterEnabled": "mochawesome, mocha-junit-reporter",
"mochawesomeReporterOptions": {
"reportDir": "results/mochawesome",
"overwrite": false,
"html": true,
"json": true,
"toConsole": true,
"consoleReporter": "spec"
},
"mochaJunitReporterReporterOptions": {
"mochaFile": "results/junit/test-results.xml"
}
noticed that if i remove "--require mochawesome/register" flag, i get same error as defined in #178
Version:
"mochawesome": "^7.1.3",
"mocha-junit-reporter": "2.2.0",
"mocha-multi-reporters": "^1.5.1"
"mocha": "^10.4.0",
The text was updated successfully, but these errors were encountered: