Running subsets of Jest tests in parallel

We use Jest to test our Node.js tests; they interact with the Postgres database to verify CRUD operations. We are currently passing the --runInBandCLI option to ensure that our tests run in serial mode, this works fine, but is obviously slower than we would like.

Now, when you read (and previous experience), it seemed to me that it was useful to be able to mark groups of tests as parallel. This is possible with nose in python, but I cannot find the syntax in Jest. Is it possible? Or is there a different approach to speeding up database tests (or states limited to generalization) that protect Jest?

Thanks Alex

+4
source share
1 answer

Put your tests in separate files (in a new subfolder if you want them to be organized). Thus, Jest runs files in parallel.

0
source

Source: https://habr.com/ru/post/1673917/


All Articles