title: How to get Grunt-Contrib-Jasmine to execute specs and load dependencies?
body: <p>The project is: Backbone + Require + Underscore + Grunt + Grunt-Contrib-Jasmine + Grunt-Lib-PhantomJS</p>
  
  <p>So two serious problems I've been battling. I know that phantomjs is running properly etc. as I get tons of runtime errors if I include my app src files. I've even ordered the deps properly such that Backbone does not barf with <code>_</code> not being defined etc.</p>
  
  <p><strong>1)</strong> When I include my application src, I get the error <code>can't find variable: define</code> for all my source files. I've tried putting requirements into <code>src[]</code> isntead of <code>vendor[]</code> and even tried loading a RequireJSConfig.js that has the deps in it.</p>
  
  <p><strong>2)</strong> Here's the cruncher: I'm pretty certain I'm pointing at my spec files properly. If I just point to <em>one test</em>, it still says <code>No Specs Executed. Is there a configuration error?</code> In my case, I just point at my <code>UserModelUnitTest.js</code>, which is very simple. It does not execute. I'm going absolutely nuts!</p>
  
  <p><strong>The Spec (UserModelUnitTest.js):</strong></p>
  
  <pre><code>describe('User Model Unit Tests', function() {
  var USER_MODEL,
      USER_CLASS,
      JSON_OBJ;
    beforeEach(function() {
      USER_CLASS = testr('models/user/User', {});
    });
  
    afterEach(function() {
      USER_MODEL = null;
      USER_CLASS = null;
      JSON_OBJ = null;
    });    
    describe('Given a json object', function() {
      it('should create a valid User', function() {
        JSON_OBJ = {"databaseId": 123456,"loginName": "god","firstName": "Jesus","lastName": "Christ","phone": "666-666-6666","email": "satan@hell.org","isoCountryCode": "US","languageCode": "en","roles" : ["SALES_REP"]};
        USER_MODEL = new USER_CLASS(JSON_OBJ, { parse: true });
        expect(USER_MODEL).not.toBe(null);
      });
      // etc...
    });
  })
  </code></pre>
  
  <p><strong>Here's my dir structure</strong></p>
  
  <pre><code>/project
   - src
       - main
       + test 
          + js
              +unit
                   UserModelUnitTest.js
  </code></pre>
  
  <p><strong>Here's my Gruntfile / Jasmine config</strong></p>
  
  <pre><code> jasmine: {
            test:{
                vendor:[
                    'src/main/resources/js/lib-clean/jquery-2.1.0.js',
                    'src/main/resources/js/lib-clean/require-2.1.1.full.js',
                    'src/main/resources/js/lib-clean/underscore-1.5.2.min.js',
                    'src/main/resources/js/lib-clean/backbone-1.1.2.min.js'
                ],
                src : [
                    // these all error like crazy. Can't find variable 'define' etc.
                    // 'src/main/**/*.js',                         
                    // 'src/main/**/**/*.js',
                    //'src/test/RequireJSConfig.js'
                ],
                helpers : [
                    'src/test/js/helpers/dependencyHelper.js',
                    'src/test/js/helpers/errorHelper.js',
                    'src/test/js/helpers/requesetHelper.js',
                    'src/test/lib/testr.js',
  
                    // jasmine.js + jasmine-html.js etc
                    'src/test/lib/*.js',
  
                    // stubs
                    'src/test/js/stubs/*.js'
                ],
                specs : [
                    'src/test/js/unit/UserModelUnitTest.js'
                ],
                //specs : 'src/test/js/unit-headless.html',
                timeout : 10000,
                phantomjs : {
                    'ignore-ssl-errors' : true
                }
            }
        },
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/MinkM.jpg" alt="But I do have specs!!!!"></p>