michaelleeallen / mocha-junit-reporter

A JUnit XML reporter for mocha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing on Mocha 8.x with parallel execution

AlvinStanescu opened this issue · comments

mocha-junit-reporter seems to be failing when executed on Mocha 8.x with parallel execution enabled.

The below error is thrown for every suite event:

mocha:parallel:parallel-buffered-runner run(): encountered uncaught exception: TypeError: Cannot read property 'length' of undefined
  mocha:parallel:parallel-buffered-runner     at isInvalidSuite (node_modules/mocha-junit-reporter/index.js:151:62)
  mocha:parallel:parallel-buffered-runner     at MochaJUnitReporter.<anonymous> (node_modules/mocha-junit-reporter/index.js:224:10)
  mocha:parallel:parallel-buffered-runner     at ParallelBufferedRunner.emit (events.js:327:22)
  mocha:parallel:parallel-buffered-runner     at emitEvent (node_modules/mocha/lib/nodejs/parallel-buffered-runner.js:120:12)
  mocha:parallel:parallel-buffered-runner     at node_modules/mocha/lib/nodejs/parallel-buffered-runner.js:197:13
  mocha:parallel:parallel-buffered-runner     at processTicksAndRejections (internal/process/task_queues.js:97:5) +1ms
  mocha:parallel:parallel-buffered-runner run(): done running file Tests\_suite.ts +10ms

Disabling test parallelization fixes the issue, but it would be great to have it working together with parallel execution.

commented

mocha-junit-reportes is failing for me in parallel mode too, but with slightly different error:

                                             ^
TypeError: Cannot read property 'testsuite' of undefined
    at lastSuite (/Users/aklamer/Documents/GitHub/i2g-underwood/node_modules/mocha-junit-reporter/index.js:209:46)```

same - #127