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

999 Views Asked by At

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'
  }
}
1

There are 1 best solutions below

0
On

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,
              ...