Mishap
Mishap

Reputation: 283

How to specify `random:true` through karma-jasmine

I'm having difficulty figuring out how/where to specify config data for Jasmine runs (which normally goes in a config file specified in Jasmine settings or through the loaded library). Specifically, I'm looking to set random:true through jasmine or karma-jasmine config.

Here the docs specify where you can add it in a config file, but I have not been able to integrate the two configuations (or tell jasmine as run through karma where to find a config file).

Upvotes: 15

Views: 8735

Answers (1)

Henry Blyth
Henry Blyth

Reputation: 1750

You can pass it through as client.jasmine in the configuration. The karma-jasmine docs say like so:

module.exports = function(config) {
  config.set({
    client: {
      jasmine: {
        random: true
      }
    }
  })
}

I have successfully used this via grunt-karma v2.0.0 with karma-jasmine v1.1.0. Annoyingly for me, grunt-karma isn't outputting the seed used each time, but I can see that the specs are randomised.

Upvotes: 26

Related Questions