@@ -51,6 +51,61 @@ describe("FastBoot", function() {
5151 } ) ;
5252 } ) ;
5353
54+ it ( "can be provided with a custom FastBoot instance" , function ( ) {
55+ let fastboot = new FastBoot ( {
56+ distPath : fixture ( 'basic-app' )
57+ } ) ;
58+
59+ let middleware = fastbootMiddleware ( {
60+ fastboot : fastboot
61+ } ) ;
62+
63+ server = new TestHTTPServer ( middleware ) ;
64+
65+ return server . start ( )
66+ . then ( ( ) => server . request ( '/' ) )
67+ . then ( html => {
68+ expect ( html ) . to . match ( / W e l c o m e t o E m b e r / ) ;
69+ } ) ;
70+ } ) ;
71+
72+ it ( "can reload the FastBoot instance" , function ( ) {
73+ let fastboot = new FastBoot ( {
74+ distPath : fixture ( 'basic-app' )
75+ } ) ;
76+
77+ let middleware = fastbootMiddleware ( {
78+ fastboot : fastboot
79+ } ) ;
80+
81+ server = new TestHTTPServer ( middleware ) ;
82+
83+ return server . start ( )
84+ . then ( requestFirstApp )
85+ . then ( hotReloadApp )
86+ . then ( requestSecondApp ) ;
87+
88+ function requestFirstApp ( info ) {
89+ return server . request ( '/' )
90+ . then ( function ( html ) {
91+ expect ( html ) . to . match ( / W e l c o m e t o E m b e r / ) ;
92+ } ) ;
93+ }
94+
95+ function hotReloadApp ( ) {
96+ fastboot . reload ( {
97+ distPath : fixture ( 'hot-swap-app' )
98+ } ) ;
99+ }
100+
101+ function requestSecondApp ( info ) {
102+ return server . request ( '/' )
103+ . then ( function ( html ) {
104+ expect ( html ) . to . match ( / G o o d b y e f r o m E m b e r / ) ;
105+ } ) ;
106+ }
107+ } ) ;
108+
54109 [ true , false ] . forEach ( ( chunkedResponse ) => {
55110 describe ( `when chunked response is ${ chunkedResponse ? 'enabled' : 'disabled' } ` , function ( ) {
56111 if ( chunkedResponse ) {
@@ -98,63 +153,6 @@ describe("FastBoot", function() {
98153 } ) ;
99154 } ) ;
100155
101- it ( "can be provided with a custom FastBoot instance" , function ( ) {
102- let fastboot = new FastBoot ( {
103- distPath : fixture ( 'basic-app' )
104- } ) ;
105-
106- let middleware = fastbootMiddleware ( {
107- fastboot : fastboot ,
108- chunkedResponse
109- } ) ;
110-
111- server = new TestHTTPServer ( middleware ) ;
112-
113- return server . start ( )
114- . then ( ( ) => server . request ( '/' ) )
115- . then ( html => {
116- expect ( html ) . to . match ( / W e l c o m e t o E m b e r / ) ;
117- } ) ;
118- } ) ;
119-
120- it ( "can reload the FastBoot instance" , function ( ) {
121- let fastboot = new FastBoot ( {
122- distPath : fixture ( 'basic-app' )
123- } ) ;
124-
125- let middleware = fastbootMiddleware ( {
126- fastboot : fastboot ,
127- chunkedResponse
128- } ) ;
129-
130- server = new TestHTTPServer ( middleware ) ;
131-
132- return server . start ( )
133- . then ( requestFirstApp )
134- . then ( hotReloadApp )
135- . then ( requestSecondApp ) ;
136-
137- function requestFirstApp ( info ) {
138- return server . request ( '/' )
139- . then ( function ( html ) {
140- expect ( html ) . to . match ( / W e l c o m e t o E m b e r / ) ;
141- } ) ;
142- }
143-
144- function hotReloadApp ( ) {
145- fastboot . reload ( {
146- distPath : fixture ( 'hot-swap-app' )
147- } ) ;
148- }
149-
150- function requestSecondApp ( info ) {
151- return server . request ( '/' )
152- . then ( function ( html ) {
153- expect ( html ) . to . match ( / G o o d b y e f r o m E m b e r / ) ;
154- } ) ;
155- }
156- } ) ;
157-
158156 describe ( 'when reslient mode is enabled' , function ( ) {
159157 it ( "renders no FastBoot markup" , function ( ) {
160158 let middleware = fastbootMiddleware ( {
0 commit comments