Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to output spec runner with grunt-contrib-jasmine?

So I've got grunt-contrib-jasmine running specs in PhantomJS. Is there a way to configure it so it always outputs _specRunner.html (to be run in a browser) instead of only upon errors?

I see this in the doc, but how do I configure this flag?

Flags

Name: build

Turn on this flag in order to build a SpecRunner html file. This is useful when troubleshooting templates, running in a browser, or as part of a watch chain e.g.

watch: {
  pivotal : {
    files: ['src/**/*.js', 'specs/**/*.js'],
    tasks: 'jasmine:pivotal:build'
  }
}
like image 747
FlavorScape Avatar asked Dec 21 '25 04:12

FlavorScape


1 Answers

I found the answer. Use options.keepRunner in your jasmine config. This will keep jasmine from deleting the _specRunner.html file after the tests exit.

 jasmine: {    
          options: {
              keepRunner: true,
              ...
like image 152
FlavorScape Avatar answered Dec 23 '25 18:12

FlavorScape



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!