title: Unable to get Jasmine working with basic library
body: <p>I'm new to using Jasmine and Grunt (and StackOverflow). I'm trying to setup the most basic of projects. However, when I run my grunt task, I get an error that says:</p>
  
  <pre><code>Running "jasmine:testShared" (jasmine) task
  Testing jasmine specs via PhantomJS
  
  &gt;&gt; Error: notloaded: Module name "../" has not been loaded yet for context: _. Use require([])
  &gt;&gt; http://requirejs.org/docs/errors.html#notloaded at
  &gt;&gt; ..\..\C:\Tests\jasmine\_SpecRunner.html:21
  &gt;&gt; ..\..\C:\Tests\jasmine\.grunt\grunt-contrib-jasmine\require.js:12 v
  &gt;&gt; ..\..\C:\Tests\jasmine\.grunt\grunt-contrib-jasmine\require.js:26 h
  &gt;&gt; ..\..\C:\Tests\jasmine\.grunt\grunt-contrib-jasmine\require.js:31
  &gt;&gt; ..\..\C:\Tests\jasmine\node_modules\glob\examples\g.js:1
  &gt;&gt; Error: notloaded: Module name "../" has not been loaded yet for context: _. Use require([])
  &gt;&gt; http://requirejs.org/docs/errors.html#notloaded at
  &gt;&gt; ..\..\C:\Tests\jasmine\_SpecRunner.html:21
  &gt;&gt; ..\..\C:\Tests\jasmine\.grunt\grunt-contrib-jasmine\require.js:12 v
  &gt;&gt; ..\..\C:\Tests\jasmine\.grunt\grunt-contrib-jasmine\require.js:26 h
  &gt;&gt; ..\..\C:\Tests\jasmine\.grunt\grunt-contrib-jasmine\require.js:31
  &gt;&gt; ..\..\C:\Tests\jasmine\node_modules\glob\examples\usr-local.js:1
  &gt;&gt; ReferenceError: Can't find variable: module at
  &gt;&gt; ..\..\C:\Tests\jasmine\node_modules\glob\glob.js:37
  &gt;&gt; Error caught from PhantomJS. More info can be found by opening the Spec Runner in a browser.
  Warning: SyntaxError: Parse error Use --force to continue.
  
  Aborted due to warnings.
  </code></pre>
  
  <p>I can't figure out what I'm doing wrong. The code for this project can be found <a href="https://onedrive.live.com/redir?resid=8AFA7F1143FA366B!107&amp;authkey=!AF6zwMN3jfXk0ug&amp;ithint=file%2C.zip" rel="nofollow">here</a>. My file structure looks like this:</p>
  
  <pre><code>/jasmine
   /node_modules
   /shared
     /modules
       myModule.js
     /tests
       /unit
         myModule.tests.js
   /tasks
     /options
       jasmine.js
       protractor.js
     test_task.js
   _SpecRunner.html
   gruntfile.js
   package.json
  </code></pre>
  
  <p>My package.json file looks like this:</p>
  
  <pre><code>{
    "name": "MyApp",
    "version": "1.0.0",
    "dependencies": {
      "async": "~0.9.0",
      "glob":"~4.0.3",
      "grunt":"~0.4.0",
      "grunt-cli":"~0.1.13",
      "grunt-contrib-connect":"0.7.1",
      "grunt-contrib-jasmine":"~0.6.5",
      "grunt-protractor-runner":"1.0.1",
      "grunt-start-webdriver":"0.0.2",
      "grunt-template-jasmine-requirejs":"0.2.0",
      "jasmine-core":"2.0.0",
      "jasmine-node":"2.0.0-beta3",
      "load-grunt-tasks":"0.2.x",
      "lodash":"~2.4.1",
      "phantomjs": "1.9.7-14",
      "selenium-webdriver":"2.42.1",       
      "time-grunt":"~0.3.2"
    }
  }
  </code></pre>
  
  <p>My gruntfile.js file looks like this:</p>
  
  <pre><code>'use strict';
  
  module.exports = function (grunt) {
      var config = {
          name: 'MyApp',
          pkg: grunt.file.readJSON('package.json'),
          baseDir: '.'
      };
  
      // load all grunt task details
      require('load-grunt-tasks')(grunt);
  
      // show elapsed time at the end
      require('time-grunt')(grunt);    
  
      // load task definitions
      grunt.loadTasks('tasks');
  
      // Utility function to load plugin settings into config
      function loadConfig(config,path) {
          require('glob').sync('*', {cwd: path}).forEach(function(option) {
              var key = option.replace(/\.js$/,'');
              // If key already exists, extend it. It is your responsibility to avoid naming collisions
              config[key] = config[key] || {};
              grunt.util._.extend(config[key], require(path + option)(config,grunt));
          });
      }
  
      // Merge that object with what with whatever we have here
      loadConfig(config,'./tasks/options/');
  
      grunt.loadNpmTasks('grunt-start-webdriver');    
      grunt.loadNpmTasks('grunt-protractor-runner');
  
      // pass the config to grunt
      grunt.initConfig(config);  
  };
  </code></pre>
  
  <p>myModule.js looks like this:</p>
  
  <pre><code>'use strict';
  
  var _ = require('lodash');
  _.mixin({
    'myFunction' : function(s) {
      return 'Hello ' + s; 
    }
  });
  
  module.exports = _;
  </code></pre>
  
  <p>myModule.tests.js looks like this:</p>
  
  <pre><code>'use strict';
  
  describe('myModule', function() {
      it('should work', function() {
          expect(true).toBe(true);
      });
  });
  </code></pre>
  
  <p>test_task.js looks like this:</p>
  
  <pre><code>module.exports = function(grunt) {
      grunt.loadNpmTasks('grunt-contrib-jasmine');
      grunt.registerTask('test-shared', [
          'jasmine:testShared'
      ]);
  };
  </code></pre>
  
  <p>jasmine.js looks like this:</p>
  
  <pre><code>module.exports = function(config) {
    return {
         testShared: {
        src: "shared/modules/*.js",
        options: {
          specs: "shared/tests/unit/**.tests.js",
          vendor: "node_modules/**/*.js",
          template: require('grunt-template-jasmine-requirejs')
          }
        }
    };
  };
  </code></pre>
  
  <p>protractor.js looks like this:</p>
  
  <pre><code>module.exports = function(config) {
    return {
         testShared: {
        options: {
          configFile: "shared/tests/unit/config.js"
          }
        }
    };
  };
  </code></pre>
  
  <p>I've spent two days on this. I have no idea what I'm doing wrong. I feel like I've followed the examples online. I feel like there is something stupid I'm overlooking. Can someone please show me what I'm doing wrong?</p>