title: Testing Angular with Jasmine/Node: Uncaught type error "Cannot set property of 'mock' undefined
body: <p>I am trying to create the Jasmine unit tests described in "Angular.js in Action". The app runs properly but I keep getting this error in the node.js command prompt when trying to run my test.</p>
  
  <p>My config:</p>
  
  <pre><code>module.exports = function(config) {
  config.set({
  
  // base path, that will be used to resolve files and exclude
  basePath: '',
  
  
  // frameworks to use
  frameworks: ['jasmine'],
  
  
  // list of files / patterns to load in the browser
  files: [
  
    'javascripts/angular.min.js',
    'javascripts/angular-mocks.js',
    'javascripts/app.js',
    'tests/angelloModelSpec.js',
    ],
  </code></pre>
  
  <p>My index.html header:</p>
  
  <pre><code>&lt;head&gt;
      &lt;script src="javascripts/angular.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="javascripts/angular-mocks.js"&gt;&lt;/script&gt;
      &lt;script src="javascripts/app.js"&gt;&lt;/script&gt;
  
  
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Angello&lt;/title&gt;
      &lt;meta name="description" content="Angello Story Application"&gt;
      &lt;link rel="stylesheet" href="app.css"&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>My test:</p>
  
  <pre><code>describe('Service: angelloModel', function(){
  
  // load the service's module
  beforeEach(module('Angello'));
  
  var modelService;
  
  // Initialize the service
  beforeEach(inject(function (angelloModel){
      modelService = angelloModel;
  }));
  
  describe('#getStatuses', function(){
      it('should return seven different statuses', function () {
          expect(modelService.getStatuses().length).toBe(7);
      });
  });
  });
  </code></pre>
  
  <p>output in command prompt:</p>
  
  <pre><code>Your environment has been set up for using Node.js 0.10.26 (x64) and npm.
  
  Your environment has been set up for using Node.js 0.10.26 (x64) and npm.
  
  C:\Users\jmclaughlin&gt;karma start karma.conf.js
  INFO [karma]: Karma v0.10.9 server started at http://localhost:****/
  INFO [launcher]: Starting browser Chrome
  INFO [Chrome 33.0.1750 (Windows 7)]: Connected on socket ***************
  Chrome 33.0.1750 (Windows 7) ERROR
      Uncaught TypeError: Cannot set property 'mock' of undefined
      at C:/Angello/javascripts/angular-mocks.js:17
  Chrome 33.0.1750 (Windows 7): Executed 0 of 0 ERROR (0.465 secs / 0 secs)
  </code></pre>
  
  <p>When using version 1.0.7 of each file:</p>
  
  <pre><code>Your environment has been set up for using Node.js 0.10.26 (x64) and npm.
  
  C:\Users\myUsername&gt;karma start karma.conf.js
  INFO [karma]: Karma v0.10.9 server started at http://localhost:****/
  INFO [launcher]: Starting browser Chrome
  INFO [Chrome 33.0.1750 (Windows 7)]: Connected on socket ***************
  Chrome 33.0.1750 (Windows 7) ERROR
      Uncaught ReferenceError: angular is not defined
      at C:/Angello/javascripts/angular-mocks.js:16
  Chrome 33.0.1750 (Windows 7): Executed 0 of 0 ERROR (0.064 secs / 0 secs)
  </code></pre>