title: Aurelia unit test route paths to modules
body: <p>I've been looking for a good pattern to unit test routes I have configured in my application so that I know the specified modules exist on disk as defined.</p>
  
  <p>Here is an example route configuration:</p>
  
  <pre><code>import { Aurelia, PLATFORM } from 'aurelia-framework';
  import { Router, RouterConfiguration } from 'aurelia-router';
  
  export class App {
      params = new bindParameters();
      router: Router;
  
  
      configureRouter(config: RouterConfiguration, router: Router) {
          config.title = 'Aurelia';
          config.map([{
              route: ['', 'home'],
              name: 'home',
              settings: { icon: 'home' },
              moduleId: PLATFORM.moduleName('../home/home'),
              nav: true,
              title: 'Home'
          }, {
              route: 'sample',
              name: 'sample',
              settings: { icon: 'education' },
              moduleId: PLATFORM.moduleName('../sample/index'),
              nav: true,
              title: 'Sample Information'
          }]);
  
          this.router = router;
      }
  }
  
  class bindParameters {
      user = "user_name";
  }
  </code></pre>
  
  <p>To test it I took the approach of passing in an instance of a router then checking to see if it exists:</p>
  
  <pre><code>import { App } from './app';
  import jasmine from 'jasmine';
  import { Container } from "aurelia-framework";
  import { RouterConfiguration, Router } from "aurelia-router";
  
  describe('application routes', function () {
      let app: App;
      let router: Router;
      let routerConfiguration: RouterConfiguration;
      let configureRouter: Promise&lt;void&gt;;
  
      beforeEach(() =&gt; {
          var container = new Container().makeGlobal();
          routerConfiguration = container.get(RouterConfiguration);
          router = container.get(Router);
          app = new App();
          app.configureRouter(routerConfiguration, router);
          configureRouter = router.configure(routerConfiguration);
          routerConfiguration.exportToRouter(router);
      });
  
      it('should exist for sample', function () {
          expect(router).not.toBeNull();
          //configureRouter.then(function () {
          //var route = router.routes.find((route) =&gt; route.name == 'sample');
          // add some assert that the sample module can be found
          //    done();
          //});
      });
  });
  </code></pre>
  
  <p>My current problem is that the container is returning a null Router as shown by the current test. The closest pattern I have found to what I am trying to do is in <a href="https://stackoverflow.com/questions/38905525/test-the-addition-of-a-route-via-configurerouter-how-do-we-see-the-navmodel">this question</a>.</p>
  
  <p>What am I missing in my example test and also is there a better way to test route configuration?</p>