@@ -15,6 +15,17 @@ describe('Basic end-to-end Workflow', function () {
15
15
16
16
after ( conf . restore ) ;
17
17
18
+ var testArgs = [
19
+ 'test' ,
20
+ '--single-run'
21
+ ] ;
22
+
23
+ // In travis CI only run tests in Firefox
24
+ if ( process . env . TRAVIS ) {
25
+ testArgs . push ( '--browsers' ) ;
26
+ testArgs . push ( 'Firefox' ) ;
27
+ }
28
+
18
29
it ( 'Installs angular-cli correctly' , function ( ) {
19
30
this . timeout ( 300000 ) ;
20
31
@@ -56,19 +67,17 @@ describe('Basic end-to-end Workflow', function () {
56
67
} ) ;
57
68
} ) ;
58
69
59
- it ( 'Perform `ng test`' , function ( done ) {
60
- this . timeout ( 30000 ) ;
70
+ it ( 'Perform `ng test` after initial build ' , function ( ) {
71
+ this . timeout ( 300000 ) ;
61
72
62
- return ng ( [
63
- 'test'
64
- ] ) . then ( function ( err ) {
65
- // TODO when `ng test` will be implemented
66
- //expect(err).to.be.equal(1);
67
- done ( ) ;
73
+ return ng ( testArgs )
74
+ . then ( function ( result ) {
75
+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
68
76
} ) ;
69
77
} ) ;
70
78
71
79
it ( 'Can create a test component using `ng generate component test-component`' , function ( ) {
80
+ this . timeout ( 10000 ) ;
72
81
return ng ( [
73
82
'generate' ,
74
83
'component' ,
@@ -82,15 +91,12 @@ describe('Basic end-to-end Workflow', function () {
82
91
} ) ;
83
92
} ) ;
84
93
85
- it ( 'Perform `ng test`' , function ( done ) {
86
- this . timeout ( 30000 ) ;
94
+ it ( 'Perform `ng test` after adding a component ' , function ( ) {
95
+ this . timeout ( 300000 ) ;
87
96
88
- return ng ( [
89
- 'test'
90
- ] ) . then ( function ( err ) {
91
- // TODO when `ng test` will be implemented
92
- //expect(err).to.be.equal(1);
93
- done ( ) ;
97
+ return ng ( testArgs )
98
+ . then ( function ( result ) {
99
+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
94
100
} ) ;
95
101
} ) ;
96
102
@@ -107,15 +113,12 @@ describe('Basic end-to-end Workflow', function () {
107
113
} ) ;
108
114
} ) ;
109
115
110
- it ( 'Perform `ng test`' , function ( done ) {
111
- this . timeout ( 30000 ) ;
116
+ it ( 'Perform `ng test` after adding a service ' , function ( ) {
117
+ this . timeout ( 300000 ) ;
112
118
113
- return ng ( [
114
- 'test'
115
- ] ) . then ( function ( err ) {
116
- // TODO when `ng test` will be implemented
117
- //expect(err).to.be.equal(1);
118
- done ( ) ;
119
+ return ng ( testArgs )
120
+ . then ( function ( result ) {
121
+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
119
122
} ) ;
120
123
} ) ;
121
124
@@ -132,15 +135,12 @@ describe('Basic end-to-end Workflow', function () {
132
135
} ) ;
133
136
} ) ;
134
137
135
- it ( 'Perform `ng test`' , function ( done ) {
136
- this . timeout ( 30000 ) ;
138
+ it ( 'Perform `ng test` after adding a pipe ' , function ( ) {
139
+ this . timeout ( 300000 ) ;
137
140
138
- return ng ( [
139
- 'test'
140
- ] ) . then ( function ( err ) {
141
- // TODO when `ng test` will be implemented
142
- //expect(err).to.be.equal(1);
143
- done ( ) ;
141
+ return ng ( testArgs )
142
+ . then ( function ( result ) {
143
+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
144
144
} ) ;
145
145
} ) ;
146
146
@@ -166,20 +166,16 @@ describe('Basic end-to-end Workflow', function () {
166
166
} ) ;
167
167
} ) ;
168
168
169
- it ( 'Perform `ng test`' , function ( done ) {
169
+ it ( 'Perform `ng test` after adding a route ' , function ( ) {
170
170
this . timeout ( 300000 ) ;
171
171
172
- return ng ( [
173
- 'test'
174
- ] ) . then ( function ( err ) {
175
- // TODO when `ng test` will be implemented
176
- //expect(err).to.be.equal(1);
177
- // Clean `tmp` folder
172
+ return ng ( testArgs )
173
+ . then ( function ( result ) {
174
+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
178
175
176
+ // Clean `tmp` folder
179
177
process . chdir ( path . resolve ( root , '..' ) ) ;
180
178
sh . rm ( '-rf' , './tmp' ) ; // tmp.teardown takes too long
181
-
182
- done ( ) ;
183
179
} ) ;
184
180
} ) ;
185
181
0 commit comments