piotrwitek / ts-mocha

Mocha thin wrapper that allows running TypeScript tests with TypeScript runtime (ts-node) to get rid of compilation complexity
MIT License
189 stars 25 forks source link

How to run parallel tests using ts-mocha #79

Closed shivang16 closed 1 year ago

shivang16 commented 2 years ago

How do we run the tests in parallel using ts-mocha? In mocha --parallel and --jobs flags help in running it. But I've tried it with ts-mocha and it's not working.

tavy121 commented 2 years ago

Hi, I find this feature very useful for a big set of tests. Do you think you can implement it?

piotrwitek commented 2 years ago

Need your config, error + stack trace to investigate. But first, you should check if that works with mocha and ts-node, because that's what this framework is doing behind the scenes.

shivang16 commented 1 year ago

Hi, If we use ts-mocha version >=8 then providing --paralleland --job=job_count flags can enable parallel tests (in the same way it is done for mocha).

I was initially using ts-mocha version<8 and due to this I could not run my tests in parallel (since in Mocha parallel tests are supported for mocha version>=8 and ts-mocha version>=8 uses mocha version>=8).

Refer this for more details: https://mochajs.org/#parallel-tests