title: Angularjs test with Jest module injection
body: <p>Trying to test angular services with Jest and got this error:</p>
  
  <pre><code>[$injector:nomod] Module 'superag' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
  </code></pre>
  
  <p>How do I mock my module 'superag' and make available to <code>mathService</code>?</p>
  
  <p>Do I have to import the <code>app.js</code> file with the module declaration every test I make?</p>
  
  <p>Ps.: I've tried with <code>beforeEach(module('superag'))</code> too without success</p>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>"jest": {
      "collectCoverageFrom": [
        "**/*.{js}",
        "!**/node_modules/**"
      ]
    },
    "devDependencies": {
      "angular-mocks": "^1.6.9",
      "jest-cli": "^23.0.0-alpha.0"
    },
    "dependencies": {
      "angular": "^1.6.9"
    }
  }
  </code></pre>
  
  <p><strong>math.service.js</strong></p>
  
  <pre><code>function MathService(){
  
      var addTwoNumbers = function(x, y){
        return x + y;
      };
  
      return {
        addTwoNumbers
      };
    }
  angular.module('superag').factory('mathservice', MathService);
  </code></pre>
  
  <p><strong>math.service.test.js</strong></p>
  
  <pre><code>require('angular');
  require('angular-mocks');
  require('./math.service.js');
  
  describe('Math service - addTwoNumbers', () =&gt; {
  
    beforeEach(
      angular.mock.module('superag')
    );
  
    var _mathservice;
  
    beforeEach(inject((mathservice) =&gt; {
      _mathservice = mathservice;
    }));
  
    it('1 + 1 should equal 2', () =&gt; {
      var actual = _mathservice.addTwoNumbers(1,1);
      expect(actual).toEqual(2);
    });
  
  });
  </code></pre>