Is it possible to conduct parallel tests using karma

At the moment, we have about 1000 unit tests written in jasmine / typescript. When I run them all, they take as much as 5 minutes on chrome. We have some unit tests that also apply to the DOM. for example, check if a button with the specified text exists. We have several files where these tests are distributed. We noticed that when we run individual files and summarize the total time, it is much less than with each test at a time. That's why we think there is a way to run tests in parallel? The plan is to separate the tests and run them in parallel.

+4
source share
1 answer

You can use karma-parallel to split tests across multiple browser instances. It runs specifications in different browser instances and is very simple and easy to install:

npm i karma-parallel

and then add "parallel" to the list of frameworks in the karma.conf.js file

module.exports = function(config) {
  config.set({
    frameworks: ['parallel', 'jasmine']
  });
};

karma-parallel

Disclosure: I am an author

+2
source

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


All Articles