Home > database >  How to run a list of test suites in a single file concurrently in jest?
How to run a list of test suites in a single file concurrently in jest?

Time:08-29

I use jest with puppeteer for testing my frontend Js library. I have stored a list of json objects in a file. Where each json object in the list is the data for a test suite. Initially, I had them stored in separate files. One file for each suite, so they used to run concurrently and finish quickly. I moved all the test suites data into a single file during refactoring. This helps me search and edit test cases better. But after adding everything to a single file, I am now looping through the testSuites data list and calling test function for each testSuite. The problem is that jest is now running things sequentially and this is taking 5x more time than the concurrent running of tests.

Is there a way to run testSuites in a single file concurrently ?

CodePudding user response:

Assuming you are not running test with the --runinband flag, the simple answer is yes but it depends

  • Related