i just upgraded to jasmine 3.3 and now my tests by default run in random order. Is there a way to configure karma and jasmine to make tests run like they used to before upgrading to this new version?
i just upgraded to jasmine 3.3 and now my tests by default run in random order. Is there a way to configure karma and jasmine to make tests run like they used to before upgrading to this new version?
In Karma config under client: you are supposed to be able to set jasmine:{random:false} but that does not work for me. Does it for you? See below link from docs and screen cap. https://github.com/karma-runner/karma-jasmine
A well-written unit test case should provide the same result independent of its execution order. However, We can change the execution order of Jasmine
Example 1- Add command line flag if you are just using Jasmine
jasmine test/sample.test.js --random=false //global installation
npx jasmine test/sample.test.js --random=false //local installation
Example 2- with karma add this to your config object.
module.exports = function (config) {
config.set({
client:{
jasmine:{
random:false
}
},
// rest of karma configuration goes here
};
//tested with karma 6.3.4 and jasmine v3.8.0