@@ -6,33 +6,44 @@ const request = RSVP.denodeify(require('request'));
66
77const AddonTestApp = require ( 'ember-cli-addon-tests' ) . AddonTestApp ;
88
9- describe ( 'FastBootLocation' , function ( ) {
9+ describe ( 'FastBootLocation' , function ( ) {
1010 this . timeout ( 300000 ) ;
1111
1212 let app ;
13- before ( function ( ) {
13+ before ( function ( ) {
1414 app = new AddonTestApp ( ) ;
1515
16- return app . create ( 'fastboot-location' , { emberVersion : 'latest' } )
17- . then ( function ( ) {
16+ return app
17+ . create ( 'fastboot-location' , {
18+ skipNpm : true ,
19+ emberVersion : 'latest' ,
20+ emberDataVersion : '~3.19.0' ,
21+ } )
22+ . then ( function ( ) {
23+ app . editPackageJSON ( ( pkg ) => {
24+ delete pkg . devDependencies [ 'ember-fetch' ] ;
25+ } ) ;
26+ return app . run ( 'npm' , 'install' ) ;
27+ } )
28+ . then ( function ( ) {
1829 return app . startServer ( {
19- command : 'serve'
30+ command : 'serve' ,
2031 } ) ;
2132 } ) ;
2233 } ) ;
2334
24- after ( function ( ) {
35+ after ( function ( ) {
2536 return app . stopServer ( ) ;
2637 } ) ;
2738
28- it ( 'should NOT redirect when no transition is called' , function ( ) {
39+ it ( 'should NOT redirect when no transition is called' , function ( ) {
2940 return request ( {
3041 url : 'http://localhost:49741/my-root/test-passed' ,
3142 followRedirect : false ,
3243 headers : {
33- Accept : 'text/html'
34- }
35- } ) . then ( function ( response ) {
44+ Accept : 'text/html' ,
45+ } ,
46+ } ) . then ( function ( response ) {
3647 if ( response . statusCode === 500 ) throw new Error ( response . body ) ;
3748 expect ( response . statusCode ) . to . equal ( 200 ) ;
3849
@@ -46,15 +57,14 @@ describe('FastBootLocation', function() {
4657 } ) ;
4758 } ) ;
4859
49- it ( 'should NOT redirect when intermediateTransitionTo is called' , function ( ) {
60+ it ( 'should NOT redirect when intermediateTransitionTo is called' , function ( ) {
5061 return request ( {
51- url :
52- 'http://localhost:49741/my-root/redirect-on-intermediate-transition-to' ,
62+ url : 'http://localhost:49741/my-root/redirect-on-intermediate-transition-to' ,
5363 followRedirect : false ,
5464 headers : {
55- Accept : 'text/html'
56- }
57- } ) . then ( function ( response ) {
65+ Accept : 'text/html' ,
66+ } ,
67+ } ) . then ( function ( response ) {
5868 if ( response . statusCode === 500 ) throw new Error ( response . body ) ;
5969 expect ( response . statusCode ) . to . equal ( 200 ) ;
6070
@@ -69,14 +79,14 @@ describe('FastBootLocation', function() {
6979 } ) ;
7080 } ) ;
7181
72- it ( 'should redirect when transitionTo is called' , function ( ) {
82+ it ( 'should redirect when transitionTo is called' , function ( ) {
7383 return request ( {
7484 url : 'http://localhost:49741/my-root/redirect-on-transition-to' ,
7585 followRedirect : false ,
7686 headers : {
77- Accept : 'text/html'
78- }
79- } ) . then ( function ( response ) {
87+ Accept : 'text/html' ,
88+ } ,
89+ } ) . then ( function ( response ) {
8090 if ( response . statusCode === 500 ) throw new Error ( response . body ) ;
8191 expect ( response . statusCode ) . to . equal ( 307 ) ;
8292
@@ -92,14 +102,14 @@ describe('FastBootLocation', function() {
92102 } ) ;
93103 } ) ;
94104
95- it ( 'should redirect when replaceWith is called' , function ( ) {
105+ it ( 'should redirect when replaceWith is called' , function ( ) {
96106 return request ( {
97107 url : 'http://localhost:49741/my-root/redirect-on-replace-with' ,
98108 followRedirect : false ,
99109 headers : {
100- Accept : 'text/html'
101- }
102- } ) . then ( function ( response ) {
110+ Accept : 'text/html' ,
111+ } ,
112+ } ) . then ( function ( response ) {
103113 if ( response . statusCode === 500 ) throw new Error ( response . body ) ;
104114 expect ( response . statusCode ) . to . equal ( 307 ) ;
105115
@@ -115,14 +125,14 @@ describe('FastBootLocation', function() {
115125 } ) ;
116126 } ) ;
117127
118- it ( 'should NOT redirect when transitionTo is called with identical route name' , function ( ) {
128+ it ( 'should NOT redirect when transitionTo is called with identical route name' , function ( ) {
119129 return request ( {
120130 url : 'http://localhost:49741/my-root/noop-transition-to' ,
121131 followRedirect : false ,
122132 headers : {
123- Accept : 'text/html'
124- }
125- } ) . then ( function ( response ) {
133+ Accept : 'text/html' ,
134+ } ,
135+ } ) . then ( function ( response ) {
126136 if ( response . statusCode === 500 ) throw new Error ( response . body ) ;
127137 expect ( response . statusCode ) . to . equal ( 200 ) ;
128138
@@ -136,14 +146,14 @@ describe('FastBootLocation', function() {
136146 } ) ;
137147 } ) ;
138148
139- it ( 'should NOT redirect when replaceWith is called with identical route name' , function ( ) {
149+ it ( 'should NOT redirect when replaceWith is called with identical route name' , function ( ) {
140150 return request ( {
141151 url : 'http://localhost:49741/my-root/noop-replace-with' ,
142152 followRedirect : false ,
143153 headers : {
144- Accept : 'text/html'
145- }
146- } ) . then ( function ( response ) {
154+ Accept : 'text/html' ,
155+ } ,
156+ } ) . then ( function ( response ) {
147157 if ( response . statusCode === 500 ) throw new Error ( response . body ) ;
148158 expect ( response . statusCode ) . to . equal ( 200 ) ;
149159
0 commit comments