grunt-contrib-jasmine
grunt-contrib-jasmine copied to clipboard
Configure the jasmine's random on gruntfile
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.
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?
This is do-able right now (I think) but the way to do it is non-obvious:
- Use a custom
boot.js. This can be accomplished by settingcustomBootFileto a path that contains a non-standard boot file. This option is unfortunately not documented. - 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.