@@ -16,6 +16,7 @@ const contentBaseOther = path.resolve(
1616) ;
1717
1818const contentBasePublicPath = '/serve-content-base-at-this-url' ;
19+ const contentBasePublicOtherPath = '/serve-other-content-at-this-url' ;
1920
2021describe ( 'contentBasePublicPath option' , ( ) => {
2122 let server ;
@@ -292,4 +293,45 @@ describe('contentBasePublicPath option', () => {
292293 req . patch ( `${ contentBasePublicPath } /` ) . expect ( 404 , done ) ;
293294 } ) ;
294295 } ) ;
296+
297+ describe ( 'multiple contentBasePublicPath entries' , ( ) => {
298+ beforeAll ( ( done ) => {
299+ server = testServer . start (
300+ config ,
301+ {
302+ contentBase : [ contentBasePublic , contentBaseOther ] ,
303+ contentBasePublicPath : [
304+ contentBasePublicPath ,
305+ contentBasePublicOtherPath ,
306+ ] ,
307+ watchContentBase : true ,
308+ port,
309+ } ,
310+ done
311+ ) ;
312+ req = request ( server . app ) ;
313+ } ) ;
314+
315+ afterAll ( ( done ) => {
316+ testServer . close ( ( ) => {
317+ done ( ) ;
318+ } ) ;
319+ } ) ;
320+
321+ it ( 'Request the first path to index' , ( done ) => {
322+ req . get ( `${ contentBasePublicPath } /` ) . expect ( 200 , / H e y o / , done ) ;
323+ } ) ;
324+
325+ it ( 'Request the first path to other file' , ( done ) => {
326+ req
327+ . get ( `${ contentBasePublicPath } /other.html` )
328+ . expect ( 200 , / O t h e r h t m l / , done ) ;
329+ } ) ;
330+
331+ it ( 'Request the second path to foo' , ( done ) => {
332+ req
333+ . get ( `${ contentBasePublicOtherPath } /foo.html` )
334+ . expect ( 200 , / F o o ! / , done ) ;
335+ } ) ;
336+ } ) ;
295337} ) ;
0 commit comments