File tree 7 files changed +85
-5
lines changed
addon/ng2/blueprints/ng2/files
7 files changed +85
-5
lines changed Original file line number Diff line number Diff line change @@ -69,19 +69,33 @@ ng build
69
69
The build artifacts will be stored in the ` dist/ ` directory.
70
70
71
71
72
- ### Running tests
72
+ ### Running unit tests
73
73
74
- Before running the tests make sure that the project is built. To build the
74
+ Before running the tests make sure that the project is built. To build the
75
75
project once you can use:
76
76
77
77
``` bash
78
78
ng build
79
79
```
80
80
81
- With the project built in the ` dist/ ` folder you can just run: ` karma start ` .
81
+ With the project built in the ` dist/ ` folder you can just run: ` karma start ` .
82
82
Karma will run the tests and keep the browser open waiting to run again.
83
83
84
- This will be easier when the command
84
+
85
+ ### Running end-to-end tests
86
+
87
+ Before running the tests make sure that you have an updated webdriver and that
88
+ the tests are built:
89
+
90
+ ``` bash
91
+ $( npm bin) /webdriver-manager update
92
+ $( npm bin) /tsc -p e2e/
93
+ ```
94
+
95
+ Afterwards you only need to run ` $(npm bin)/protractor ` while serving via
96
+ ` ng serve ` .
97
+
98
+ This will be easier when the command
85
99
[ ng test] ( https://github.com/angular/angular-cli/issues/70 ) is implemented.
86
100
87
101
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 18
18
/libpeerconnection.log
19
19
npm-debug.log
20
20
testem.log
21
+
22
+ # e2e
23
+ /e2e/*.js
24
+ /e2e/*.map
Original file line number Diff line number Diff line change 25
25
"jasmine-core" : " ^2.3.4" ,
26
26
"karma" : " ^0.13.15" ,
27
27
"karma-chrome-launcher" : " ^0.2.1" ,
28
- "karma-jasmine" : " ^0.3.6"
28
+ "karma-jasmine" : " ^0.3.6" ,
29
+ "protractor" : " ^3.0.0" ,
30
+ "typescript" : " ^1.7.3"
29
31
}
30
32
}
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