mocha-parallel-tests icon indicating copy to clipboard operation
mocha-parallel-tests copied to clipboard

Unhandled asynchronous exception: TypeError: this.suite[option] is not a function

Open stevenlafl opened this issue 4 years ago • 4 comments

Unhandled asynchronous exception: TypeError: this.suite[option] is not a function
  at MochaWrapper.getThreadOptions (/node_modules/mocha-parallel-tests/dist/main/mocha.js:148:49)
  at MochaWrapper.runThread (/node_modules/mocha-parallel-tests/dist/main/mocha.js:115:30)
  at task (/node_modules/mocha-parallel-tests/dist/main/mocha.js:56:37)
  at TaskManager.startTaskProcessing (/node_modules/mocha-parallel-tests/dist/main/task-manager.js:46:27)
  at TaskManager.execute (/node_modules/mocha-parallel-tests/dist/main/task-manager.js:35:18)
  at MochaWrapper.run (/node_modules/mocha-parallel-tests/dist/main/mocha.js:66:21)
  at Object.<anonymous> (/node_modules/mocha-parallel-tests/dist/bin/cli.js:189:7)
  at Module._compile (internal/modules/cjs/loader.js:1138:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
 at Module.load (internal/modules/cjs/loader.js:986:32)

Test code:

describe('test', () => {
  it('tests', async () => {
  });
});

I have tried many different tests I could run under mocha, but this is the simplest that fails.

Starting with mocha-parallel-tests -R xunit --timeout 10000 --slow 1000 tests/*.test.js

stevenlafl avatar Jun 25 '20 08:06 stevenlafl

I started to see this after upgrading Mocha to v8.x.

mastermatt avatar Jun 26 '20 13:06 mastermatt

@mastermatt out of interest, mocha@8 supports parallel mode, does it work for you?

1999 avatar Jul 10 '20 09:07 1999

Using the parallel mode out of the box in mocha 8 isn't straight forward in my case. I'm moving in that direction, but I was hoping to continue using mocha-parallel-tests in the mean time.

mastermatt avatar Jul 10 '20 22:07 mastermatt

Any updated on this issue @1999 ?

Pritam-RoyChowdhury avatar Apr 13 '21 07:04 Pritam-RoyChowdhury