title: Getting requirejs to work with Jasmine
body: <p>I first want to say that I am new to RequireJS and even newer to Jasmine. </p>
  
  <p>I am having some issues with the SpecRunner and require JS.  I have been following the tutorials of Uzi Kilon and Ben Nadel (along with some others) and they helped some but I am still having some issues.  </p>
  
  <p>It seems that, if there is an error that is thrown in the test (I can think of one in particular, a type error) the spec runner html will display.  This tells me that I have some issues in the javascript.  However, after I fix those error no HTML is displayed anymore.  <strong>I cannot get the test runner to display at all.  Can someone find something wrong with my code that would cause this issue?</strong></p>
  
  <p>Here is my <strong>directory structure</strong>:</p>
  
  <pre><code>Root 
  |-&gt; lib
      |-&gt; jasmine
          |-&gt; lib (contains all of the jasmine lib)
          |-&gt; spec
          |-&gt; src
      |-&gt; jquery (jquery js file)
      |-&gt; require (require js file) 
  index.html (spec runner) specRunner.js
  </code></pre>
  
  <p>Here is the <strong>SpecRunner (index) HTML</strong>:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;title&gt;Javascript Tests&lt;/title&gt;
  
          &lt;link rel="stylesheet" href="lib/jasmine/lib/jasmine.css"&gt;
  
          &lt;script src="lib/jasmine/lib/jasmine.js"&gt;&lt;/script&gt;
          &lt;script src="lib/jasmine/lib/jasmine-html.js"&gt;&lt;/script&gt;
          &lt;script src="lib/jquery/jquery.js"&gt;&lt;/script&gt;
          &lt;script data-main="specRunner" src="lib/require/require.js"&gt;&lt;/script&gt;
  
          &lt;script&gt;
              require({ paths: { spec: "lib/jasmine/spec" } }, [
                      // Pull in all your modules containing unit tests here.
                      "spec/notepadSpec"
                  ], function () {
                      jasmine.getEnv().addReporter(new jasmine.HtmlReporter());
                      jasmine.getEnv().execute();
                  });
          &lt;/script&gt;
  
      &lt;/head&gt;
  
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is the <strong>specRunner.js (config)</strong></p>
  
  <pre><code>require.config({
      urlArgs: 'cb=' + Math.random(),
      paths: {
          jquery: 'lib/jquery',
          jasmine: 'lib/jasmine/lib/jasmine',
          'jasmine-html': 'lib/jasmine/lib/jasmine-html',
          spec: 'lib/jasmine/spec/'
      },
      shim: {
          jasmine: {
              exports: 'jasmine'
          },
          'jasmine-html': {
              deps: ['jasmine'],
              exports: 'jasmine'
          }
      }
  });
  </code></pre>
  
  <p>Here is a spec:</p>
  
  <pre><code>require(["../lib/jasmine/src/notepad"], function (notepad) {
      describe("returns titles", function() {
          expect(notepad.noteTitles()).toEqual("");
  
  
      });
  });
  </code></pre>
  
  <p>The notepad source:</p>
  
  <pre><code>define(['lib/jasmine/src/note'], function (note) {
  
      var notes = [
          new note('pick up the kids', 'dont forget to pick  up the kids'),
          new note('get milk', 'we need two gallons of milk')
      ];
  
  
      return {
          noteTitles: function () {
              var val;
  
              for (var i = 0, ii = notes.length; i &lt; ii; i++) {
                  //alert(notes[i].title);
                  val += notes[i].title + ' ';
              }
  
              return val;
          }
      };
  });
  </code></pre>
  
  <p>And the Note source (JIC):</p>
  
  <pre><code>define(function (){
      var note = function(title, content) {
          this.title = title;
          this.content = content;
      };
  
      return note;
  });
  </code></pre>
  
  <p>I have made sure that, as far as the app is concerned, the paths are correct.  Once I get this working I can play with configuring that paths so that it isn't so yucky.  </p>