title: Jasmine - Using a Custom Reporter
body: <p>I am testing some JavaScript with <a href="http://jasmine.github.io/" rel="nofollow">Jasmine</a> via <a href="http://gulpjs.com/" rel="nofollow">Gulp</a>. I want to create my own reporter. At this time, my reporter is as basic as it gets. It looks like this:</p>
  
  <pre><code>'use strict';
  
  var myCustomReporter = {
      jasmineStarted: function(suiteInfo) {
          console.log('Running suite with ' + suiteInfo.totalSpecsDefined);
          console.log('Reporting via MyCustomReporter');      
      },
  
      suiteStarted: function(result) {
          console.log('Suite started: ' + result.description + ' whose full description is: ' + result.fullName);     
      },
  
      specStarted: function(result) {
          console.log('Spec started: ' + result.description + ' whose full description is: ' + result.fullName);
      },
  
      specDone: function(result) {
      },
  
      suiteDone: function(result) {
      },
  
      jasmineDone: function() {
          console.log('Finished suite');
      }   
  };
  </code></pre>
  
  <p>The above code is essentially the <a href="http://jasmine.github.io/2.3/custom_reporter.html" rel="nofollow">example custom reporter</a> provided by Jasmine. My challenge is, I cannot figure out how to get Jasmine to actually use it. Some how, I'm adding it incorrectly. I'm adding it like this:</p>
  
  <pre><code> gulp.task('test', function() {
      // Load the reporters to use with Jasmine
      var myReporter = require('./reporters/myCustomReporter');   
      var reporters = [
          myReporter
      ];
  
      return gulp.src(input.tests)
          .pipe(jasmine({ reporter: reporters }))
      ;
   });
  </code></pre>
  
  <p>When I execute the <code>test</code> task via Gulp, I get the following output:</p>
  
  <pre><code>[08:04:15] Using gulpfile ~/MyProject/gulpfile.js
  [08:04:15] Starting 'test'...
  [08:04:20] 'test' errored after 5.25 s
  [08:04:20] Error in plugin 'gulp-jasmine'
  Message:
      Tests failed
  </code></pre>
  
  <p>If I do NOT pass along <code>{ reporter: reporters }</code> in my call to Jasmine, my tests run just fine. I'm trying to learn how to a) Add my reporter and b) Still use the default reporter. Essentially, I'm trying to figure out how to send the results to multiple reporters. I think my approach is correct. Clearly, the results are showing I'm wrong though. </p>