Are test cases in Jasmine 2.0 run in parallel

后端 未结 2 1409
时光说笑
时光说笑 2021-01-17 19:18

Are tests in Jasmine 2.0 run in parallel? In my experience they aren\'t but the article , referenced by Jasmine.js: Race Conditions when using "runs" suggests tha

相关标签:
2条回答
  • 2021-01-17 19:27

    Jasmine does not actually run your specs in parallel in any way. It is however possible to have specs whose asynchronous portion takes long enough that the built-in time limit elapses which will cause jasmine to start running the next spec, even though there may still be code running from earlier specs.

    0 讨论(0)
  • 2021-01-17 19:40

    If you want to run your test in parallel and you are using karma as a test launcher, you can use karma-parallel to split up your tests across multiple browser instances. It runs specs in different browser instances and is very simple and easy to install:

    npm i karma-parallel
    

    and then add the 'parallel' to the frameworks list in karma.conf.js

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

    karma-parallel

    Disclosure: I am the author

    0 讨论(0)
提交回复
热议问题