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

Configure the jasmine's random on gruntfile #297

Open
doug-source opened this issue Jan 15, 2019 · 2 comments
Open

Configure the jasmine's random on gruntfile #297

doug-source opened this issue Jan 15, 2019 · 2 comments

Comments

@doug-source
Copy link

doug-source commented Jan 15, 2019

How can I configure the random option using grunt-contrib-jasmine? I can do it directly with jasmine's command line, but running jasmine's task by grunt-cli I didn't find the random option. Then the output of command line always shows the specs' randomic output.

@doug-source doug-source changed the title Configure the jasmine's random Configure the jasmine's random on gruntfile Jan 15, 2019
@mojoaxel
Copy link

mojoaxel commented May 2, 2019

There are a lot of jasmine options that are not mentioned at all in the grunt-contrib-jasmine configuration docs. e.g.:

  • random
  • hideDisabled
  • seed

Is is possible to set these options? How?

@jabbany
Copy link
Contributor

jabbany commented May 29, 2019

This is do-able right now (I think) but the way to do it is non-obvious:

  1. Use a custom boot.js. This can be accomplished by setting customBootFile to a path that contains a non-standard boot file. This option is unfortunately not documented.
  2. Change the standard boot file (see link above), by adding a step to "configure" the environment.

Find this line from the example linked above

var env = jasmine.getEnv();

and add after it

env.configure({
    // Whatever needs to be configured here
})

If you are already using a custom template, something similar can be done in its reporter.js through jasmine.getEnv(). There is also the potential of creating a mixin to inject this code to the child template.

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

No branches or pull requests

4 participants