@@ -15,6 +15,17 @@ describe('Basic end-to-end Workflow', function () {
1515
1616 after ( conf . restore ) ;
1717
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+
1829 it ( 'Installs angular-cli correctly' , function ( ) {
1930 this . timeout ( 300000 ) ;
2031
@@ -55,19 +66,17 @@ describe('Basic end-to-end Workflow', function () {
5566 } ) ;
5667 } ) ;
5768
58- it ( 'Perform `ng test`' , function ( done ) {
59- this . timeout ( 30000 ) ;
69+ it ( 'Perform `ng test` after initial build ' , function ( ) {
70+ this . timeout ( 300000 ) ;
6071
61- return ng ( [
62- 'test'
63- ] ) . then ( function ( err ) {
64- // TODO when `ng test` will be implemented
65- //expect(err).to.be.equal(1);
66- done ( ) ;
72+ return ng ( testArgs )
73+ . then ( function ( result ) {
74+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
6775 } ) ;
6876 } ) ;
6977
7078 it ( 'Can create a test component using `ng generate component test-component`' , function ( ) {
79+ this . timeout ( 10000 ) ;
7180 return ng ( [
7281 'generate' ,
7382 'component' ,
@@ -81,15 +90,12 @@ describe('Basic end-to-end Workflow', function () {
8190 } ) ;
8291 } ) ;
8392
84- it ( 'Perform `ng test`' , function ( done ) {
85- this . timeout ( 30000 ) ;
93+ it ( 'Perform `ng test` after adding a component ' , function ( ) {
94+ this . timeout ( 300000 ) ;
8695
87- return ng ( [
88- 'test'
89- ] ) . then ( function ( err ) {
90- // TODO when `ng test` will be implemented
91- //expect(err).to.be.equal(1);
92- done ( ) ;
96+ return ng ( testArgs )
97+ . then ( function ( result ) {
98+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
9399 } ) ;
94100 } ) ;
95101
@@ -106,15 +112,12 @@ describe('Basic end-to-end Workflow', function () {
106112 } ) ;
107113 } ) ;
108114
109- it ( 'Perform `ng test`' , function ( done ) {
110- this . timeout ( 30000 ) ;
115+ it ( 'Perform `ng test` after adding a service ' , function ( ) {
116+ this . timeout ( 300000 ) ;
111117
112- return ng ( [
113- 'test'
114- ] ) . then ( function ( err ) {
115- // TODO when `ng test` will be implemented
116- //expect(err).to.be.equal(1);
117- done ( ) ;
118+ return ng ( testArgs )
119+ . then ( function ( result ) {
120+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
118121 } ) ;
119122 } ) ;
120123
@@ -131,15 +134,12 @@ describe('Basic end-to-end Workflow', function () {
131134 } ) ;
132135 } ) ;
133136
134- it ( 'Perform `ng test`' , function ( done ) {
135- this . timeout ( 30000 ) ;
137+ it ( 'Perform `ng test` after adding a pipe ' , function ( ) {
138+ this . timeout ( 300000 ) ;
136139
137- return ng ( [
138- 'test'
139- ] ) . then ( function ( err ) {
140- // TODO when `ng test` will be implemented
141- //expect(err).to.be.equal(1);
142- done ( ) ;
140+ return ng ( testArgs )
141+ . then ( function ( result ) {
142+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
143143 } ) ;
144144 } ) ;
145145
@@ -165,20 +165,16 @@ describe('Basic end-to-end Workflow', function () {
165165 } ) ;
166166 } ) ;
167167
168- it ( 'Perform `ng test`' , function ( done ) {
168+ it ( 'Perform `ng test` after adding a route ' , function ( ) {
169169 this . timeout ( 300000 ) ;
170170
171- return ng ( [
172- 'test'
173- ] ) . then ( function ( err ) {
174- // TODO when `ng test` will be implemented
175- //expect(err).to.be.equal(1);
176- // Clean `tmp` folder
171+ return ng ( testArgs )
172+ . then ( function ( result ) {
173+ expect ( result . exitCode ) . to . be . equal ( 0 ) ;
177174
175+ // Clean `tmp` folder
178176 process . chdir ( path . resolve ( root , '..' ) ) ;
179177 sh . rm ( '-rf' , './tmp' ) ; // tmp.teardown takes too long
180-
181- done ( ) ;
182178 } ) ;
183179 } ) ;
184180
0 commit comments