File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
packages/angular-cli/blueprints/ng2/files/__path__/app
tests/e2e/tests/commands/new Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 11/* tslint:disable:no-unused-variable */
22
3- import { TestBed , async } from '@angular/core/testing' ;
3+ import { TestBed , async } from '@angular/core/testing' ; < % if ( routing ) { % >
4+ import { RouterTestingModule } from '@angular/router/testing' ; < % } % >
45import { AppComponent } from './app.component' ;
56
67describe ( 'AppComponent' , ( ) => {
78 beforeEach ( ( ) => {
8- TestBed . configureTestingModule ( {
9+ TestBed . configureTestingModule ( { < % if ( routing ) { % >
10+ imports : [
11+ RouterTestingModule
12+ ] , < % } % >
913 declarations : [
1014 AppComponent
1115 ] ,
1216 } ) ;
17+ TestBed . compileComponents ( ) ;
1318 } ) ;
1419
1520 it ( 'should create the app' , async ( ( ) => {
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import { APP_SHELL_DIRECTIVES } from '@angular/app-shell';<% } %>
66 template : `
77 <h1>
88 {{title}}
9- </h1>
9+ </h1><% if (routing) { %>
10+ <router-outlet></router-outlet><% } %>
1011 ` , < % } else { % >
1112 templateUrl : './app.component.html' , < % } % > < % if ( inlineStyle ) { % >
1213 styles : [ ] < % } else { % >
Original file line number Diff line number Diff line change 1+ import * as path from 'path' ;
2+ import { ng } from '../../../utils/process' ;
3+ import { getGlobalVariable } from '../../../utils/env' ;
4+
5+ export default function ( ) {
6+ return Promise . resolve ( )
7+ . then ( ( ) => process . chdir ( getGlobalVariable ( 'tmp-root' ) ) )
8+ . then ( ( ) => ng ( 'new' , 'routing-project' , '--routing' ) )
9+ . then ( ( ) => process . chdir ( path . join ( 'routing-project' ) ) )
10+
11+ // Try to run the unit tests.
12+ . then ( ( ) => ng ( 'test' , '--single-run' ) ) ;
13+ }
You can’t perform that action at this time.
0 commit comments