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).
Currently (v2. x) Jasmine runs tests in the order they are defined.
We can run Jasmine tests in a browser ourselves by setting up and loading a HTML file, but more commonly we use a command-line tool called Karma. Karma handles the process of creating HTML files, opening browsers and running tests and returning the results of those tests to the command line.
Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests. Karma is a test runner that fits all our needs in the angular framework.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With