File tree 3 files changed +22
-3
lines changed
packages/angular-cli/blueprints/ng2/files/__path__/app
tests/e2e/tests/commands/new
3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1
1
/* tslint:disable:no-unused-variable */
2
2
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' ; < % } % >
4
5
import { AppComponent } from './app.component' ;
5
6
6
7
describe ( 'AppComponent' , ( ) => {
7
8
beforeEach ( ( ) => {
8
- TestBed . configureTestingModule ( {
9
+ TestBed . configureTestingModule ( { < % if ( routing ) { % >
10
+ imports : [
11
+ RouterTestingModule
12
+ ] , < % } % >
9
13
declarations : [
10
14
AppComponent
11
15
] ,
12
16
} ) ;
17
+ TestBed . compileComponents ( ) ;
13
18
} ) ;
14
19
15
20
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';<% } %>
6
6
template : `
7
7
<h1>
8
8
{{title}}
9
- </h1>
9
+ </h1><% if (routing) { %>
10
+ <router-outlet></router-outlet><% } %>
10
11
` , < % } else { % >
11
12
templateUrl : './app.component.html' , < % } % > < % if ( inlineStyle ) { % >
12
13
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