File tree 7 files changed +86
-6
lines changed
addon/ng2/blueprints/ng2/files
7 files changed +86
-6
lines changed Original file line number Diff line number Diff line change @@ -67,19 +67,33 @@ ng build
67
67
The build artifacts will be stored in the ` dist/ ` directory.
68
68
69
69
70
- ### Running tests
70
+ ### Running unit tests
71
71
72
- Before running the tests make sure that the project is built. To build the
72
+ Before running the tests make sure that the project is built. To build the
73
73
project once you can use:
74
74
75
75
``` bash
76
76
ng build
77
77
```
78
78
79
- With the project built in the ` dist/ ` folder you can just run: ` karma start ` .
79
+ With the project built in the ` dist/ ` folder you can just run: ` karma start ` .
80
80
Karma will run the tests and keep the browser open waiting to run again.
81
81
82
- This will be easier when the command
82
+
83
+ ### Running end-to-end tests
84
+
85
+ Before running the tests make sure that you have an updated webdriver and that
86
+ the tests are built:
87
+
88
+ ``` bash
89
+ $( npm bin) /webdriver-manager update
90
+ $( npm bin) /tsc -p e2e/
91
+ ```
92
+
93
+ Afterwards you only need to run ` $(npm bin)/protractor ` while serving via
94
+ ` ng serve ` .
95
+
96
+ This will be easier when the command
83
97
[ ng test] ( https://github.com/angular/angular-cli/issues/70 ) is implemented.
84
98
85
99
Original file line number Diff line number Diff line change
1
+ import "angular2/testing" ;
2
+ import { < %= jsComponentName % > Page } from './app.po' ;
3
+
4
+ describe ( '<%= htmlComponentName %> App' , function ( ) {
5
+ let page : < %= jsComponentName % > Page ;
6
+
7
+ beforeEach ( ( ) => {
8
+ page = new < %= jsComponentName % > Page ( ) ;
9
+ } )
10
+
11
+ it ( 'should display message saying app works' , ( ) => {
12
+ page . navigateTo ( )
13
+ expect ( page . getParagraphText ( ) ) . toEqual ( '<%= htmlComponentName %> Works!' ) ;
14
+ } ) ;
15
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import "angular2/testing" ;
2
+
3
+ export class < %= jsComponentName % > Page {
4
+ navigateTo ( ) { return browser . get ( '/' ) ; }
5
+ getParagraphText ( ) { return element ( by . css ( '<%= jsComponentName %>-app p' ) ) . getText ( ) ; }
6
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : " ES5" ,
4
+ "module" : " commonjs" ,
5
+ "sourceMap" : true ,
6
+ "declaration" : false ,
7
+ "emitDecoratorMetadata" : true ,
8
+ "experimentalDecorators" : true ,
9
+ "removeComments" : false
10
+ }
11
+ }
Original file line number Diff line number Diff line change 14
14
/coverage/*
15
15
/libpeerconnection.log
16
16
npm-debug.log
17
- testem.log
17
+ testem.log
18
+
19
+ # e2e
20
+ /e2e/*.js
21
+ /e2e/*.map
Original file line number Diff line number Diff line change 18
18
"jasmine-core" : " ^2.3.4" ,
19
19
"karma" : " ^0.13.15" ,
20
20
"karma-chrome-launcher" : " ^0.2.1" ,
21
- "karma-jasmine" : " ^0.3.6"
21
+ "karma-jasmine" : " ^0.3.6" ,
22
+ "protractor" : " ^3.0.0" ,
23
+ "typescript" : " ^1.7.3"
22
24
}
23
25
}
Original file line number Diff line number Diff line change
1
+ exports . config = {
2
+ allScriptsTimeout : 11000 ,
3
+
4
+ specs : [
5
+ 'e2e/**/*.e2e.js'
6
+ ] ,
7
+
8
+ capabilities : {
9
+ 'browserName' : 'chrome'
10
+ } ,
11
+
12
+ directConnect : true ,
13
+
14
+ baseUrl : 'http://localhost:4200/' ,
15
+
16
+ framework : 'jasmine' ,
17
+
18
+ jasmineNodeOpts : {
19
+ defaultTimeoutInterval : 30000
20
+ } ,
21
+
22
+ useAllAngular2AppRoots : true ,
23
+
24
+ beforeLaunch : function ( ) {
25
+ require ( 'zone.js' ) ;
26
+ require ( 'reflect-metadata' ) ;
27
+ }
28
+ } ;
You can’t perform that action at this time.
0 commit comments