Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with random flag #194

Open
alexboisselle-rd opened this issue Feb 28, 2018 · 2 comments
Open

Issue with random flag #194

alexboisselle-rd opened this issue Feb 28, 2018 · 2 comments

Comments

@alexboisselle-rd
Copy link

alexboisselle-rd commented Feb 28, 2018

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)
    }
  }
}
@alexboisselle-rd
Copy link
Author

bump any word on this? It's a hinder to the workflow.

@fadc80
Copy link
Contributor

fadc80 commented Jun 22, 2018

What jasmine version are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants