karma-jasmine
karma-jasmine copied to clipboard
Issue with random flag
Currently using 1.1.1
When setting the random flag to false in the karma conf file:
client: {
jasmine: {
random: false
}
}
The createStartFn function in adapter.js (pasted below) fails because jasmineEnv.randomizeTests is not defined. The function isn't predicted to call a randomizer, however the issue is the function is throwing errors since I used "false" (boolean) in as the flag value and we're only validating against "null" (object) and for some reason JS is allowing the "set(option)" to run, although set is undefined, therefor throwing errors.
When using "null" or "undefined", the we get random executing again, meaning the flag didn't work.
Perhaps I'm missing something, any hint would be great.
function createStartFn (karma, jasmineEnv) {
return function () {
var clientConfig = karma.config || {}
var jasmineConfig = clientConfig.jasmine || {}
jasmineEnv = jasmineEnv || window.jasmine.getEnv()
setOption(jasmineConfig.stopOnFailure, jasmineEnv.throwOnExpectationFailure)
setOption(jasmineConfig.seed, jasmineEnv.seed)
setOption(jasmineConfig.random, jasmineEnv.randomizeTests)
jasmineEnv.addReporter(new KarmaReporter(karma, jasmineEnv))
jasmineEnv.execute()
}
function setOption (option, set) {
if (option != null) {
set(option)
}
}
}
bump any word on this? It's a hinder to the workflow.
What jasmine version are you using?