title: How to fix "Module is not available!" when unit testing a Hybrid Angular app
body: <p>I have a hybrid angular app and unit testing with Karma-Jasmine but we hit a small problem. I have a factory and component that is downgraded as an AngularJS app with:</p>
  
  <pre><code>angular
      .module('app.admin.branding')
      .factory('brandingFactory', downgradeInjectable(BrandingFactory));
  
  </code></pre>
  
  <pre><code>angular
      .module('app.admin.branding')
      .directive('BrandNameComponent', downgradeComponent({
          component: BrandNameComponent
      }));
  </code></pre>
  
  <p>but it returns a <code>Module 'app.admin.branding' is not available!</code> upon running <code>ng test</code></p>
  
  <p>so the solution was adding brackets.</p>
  
  <pre><code>angular
      .module('app.admin.branding', [])
  </code></pre>
  
  <p>for both the component and factory. It works and the unit tests runs but when running on the browser and navigates to a page where the component is used an unknown error occurs and redirected to the main page. </p>
  
  <p>So we just removed the brackets for both classes as it affected our production app. How do we fix our unit test error <code>Module 'app.admin.branding' is not available</code> or is there any workaround with the brackets approach so that it won't redirect?</p>