@@ -50,26 +50,37 @@ describe('core lifecycle handlers', () => {
5050
5151 beforeEach ( async ( ) => {
5252 const configService = configServiceMock . create ( ) ;
53- configService . atPath . mockReturnValue (
54- new BehaviorSubject ( {
55- hosts : [ 'localhost' ] ,
56- maxPayload : new ByteSizeValue ( 1024 ) ,
57- autoListen : true ,
58- ssl : {
59- enabled : false ,
60- } ,
61- compression : { enabled : true } ,
62- name : kibanaName ,
63- customResponseHeaders : {
64- 'some-header' : 'some-value' ,
65- } ,
66- xsrf : { disableProtection : false , allowlist : [ allowlistedTestPath ] } ,
67- requestId : {
68- allowFromAnyIp : true ,
69- ipAllowlist : [ ] ,
70- } ,
71- } as any )
72- ) ;
53+ configService . atPath . mockImplementation ( ( path ) => {
54+ if ( path === 'server' ) {
55+ return new BehaviorSubject ( {
56+ hosts : [ 'localhost' ] ,
57+ maxPayload : new ByteSizeValue ( 1024 ) ,
58+ autoListen : true ,
59+ ssl : {
60+ enabled : false ,
61+ } ,
62+ compression : { enabled : true } ,
63+ name : kibanaName ,
64+ customResponseHeaders : {
65+ 'some-header' : 'some-value' ,
66+ } ,
67+ xsrf : { disableProtection : false , allowlist : [ allowlistedTestPath ] } ,
68+ requestId : {
69+ allowFromAnyIp : true ,
70+ ipAllowlist : [ ] ,
71+ } ,
72+ } as any ) ;
73+ }
74+ if ( path === 'externalUrl' ) {
75+ return new BehaviorSubject ( {
76+ policy : [ ] ,
77+ } as any ) ;
78+ }
79+ if ( path === 'csp' ) {
80+ return new BehaviorSubject ( { } as any ) ;
81+ }
82+ throw new Error ( `Unexpected config path: ${ path } ` ) ;
83+ } ) ;
7384 server = createHttpServer ( { configService } ) ;
7485
7586 const serverSetup = await server . setup ( setupDeps ) ;
0 commit comments